小编use*_*007的帖子

VisualStudio 2012将文件添加为另一个文件的子项

除了手动编辑项目文件外,是否可以在Visual Studio中将File添加为另一个文件的子项?我已经将MyView.xaml.cs文件作为MyView.xaml的子项,但希望MyviewModel.cs以及MyView.xaml的子项.

MyView.xaml
 |_MyView.xaml.cs
 | 
 |_MyviewModel.cs 
Run Code Online (Sandbox Code Playgroud)

visual-studio

5
推荐指数
1
解决办法
1859
查看次数

无法使用Jupyter在Visual Studio Code中运行Python代码-“无法从'Python 3.6.8 64位启动Jupyter内核”

我已经在最新的Visual Studio中安装了Jupyter扩展:Visual Studio 1.3.01 64 Jupyter 1.1.4

当我使用tensorflow时,我需要Python 3 64bit。

当我尝试运行简单的代码时,我得到:

Jupyter kernel cannot be started from 'Python 3.6.8 64-bit ('tensorflow64': virtualenv)'. Using closest match Python 3.7.0 32-bit instead.
Run Code Online (Sandbox Code Playgroud)

码:

#%%
import tensorflow as tf

session = tf.Session()

hello = tf.constant("Hello from Milan.")
print(session.run(hello))

a = tf.constant(20)
b = tf.constant(22)

print('a + b = {0}'.format(session.run(a + b)))
Run Code Online (Sandbox Code Playgroud)

如果我不使用VS Code中的Jupyter运行代码,则一切正常。

python visual-studio-code jupyter-notebook

5
推荐指数
1
解决办法
2935
查看次数

桌面DLL中的Prism PopupChildWindowAction缺失

我正在尝试在WPF Prism Desktop应用程序中实现模式对话框.

从Prism指导我可以看到正确的方法应该是使用Interaction:

<i:Interaction.Triggers>
    <prism:InteractionRequestTrigger 
            SourceObject="{Binding ConfirmCancelInteractionRequest}">

        <prism:PopupChildWindowAction
                  ContentTemplate="{StaticResource ConfirmWindowTemplate}"/>

    </prism:InteractionRequestTrigger>
</i:Interaction.Triggers>
Run Code Online (Sandbox Code Playgroud)

但是PopupChildWindowAction在桌面的Microsoft.Practices.Prism.Interactivity.DLL库中没有,只有Silverlight?

我可以谷歌在WPF(Prism)的Modal对话框的许多不同的实现,但只是想知道为什么这个功能从Prism桌面DLL丢失,并在Silverlight DLL中可用?我可以使用交互服务,但建议使用交互请求作为MVVM应用程序的更合适的方法.

c# wpf prism mvvm prism-4

3
推荐指数
1
解决办法
2495
查看次数

IObservable 序列完成前的聚合函数

有没有办法在序列完成之前将聚合函数(Max、Count、....)与 Buffer 一起使用。完成后这将产生结果,但继续流它不会给出任何结果?

我期待有什么方法可以使这个工作与缓冲区一起工作?

IObservable<long> source;
IObservable<IGroupedObservable<long, long>> group  = source
        .Buffer(TimeSpan.FromSeconds(5))
        .GroupBy(i => i % 3);

IObservable<long> sub = group.SelectMany(grp => grp.Max());

sub.Subscribe(l =>
{
    Console.WriteLine("working");
});
Run Code Online (Sandbox Code Playgroud)

c# system.reactive

2
推荐指数
1
解决办法
711
查看次数

WPF动画的DataGridRow背景颜色从透明变为“当前”(通过“触发器”设置当前值)

DataGridRow BackgroundColor根据触发LogError值设置为绿色或红色。

我想为新添加的行设置透明度。

这很好用:

From="Transparent" To="Red"
Run Code Online (Sandbox Code Playgroud)

但是我想要的颜色是使用Style设置的当前颜色。它并不总是红色,也可能是绿色。

这不起作用:

From="Transparent" To="{TemplateBinding DataGridRow.Background}"
Run Code Online (Sandbox Code Playgroud)

要么

From="Transparent" To="{Binding RelativeSource={RelativeSource Self}, Path=Backgound}"
Run Code Online (Sandbox Code Playgroud)

码:

<DataGrid.Resources>
  <Style TargetType="{x:Type DataGridRow}">
    <Setter Property = "Background" Value="LimeGreen"/>
    <Style.Triggers>
      <DataTrigger Binding="{Binding LogMessage}" Value="Exception has occured">
        <Setter Property = "Background" Value="Red"/>
      </DataTrigger>
    </Style.Triggers>
  </Style>
</DataGrid.Resources>          
<DataGrid.RowStyle>
  <Style TargetType="DataGridRow">
    <Style.Triggers>
      <EventTrigger RoutedEvent="Loaded">
        <BeginStoryboard>
          <Storyboard>
            <ColorAnimation
                Storyboard.TargetProperty="(DataGridRow.Background).(SolidColorBrush.Color)" 
                Duration="00:00:03" 
                From="Transparent"
                To="{TemplateBinding DataGridRow.Background}"/>
          </Storyboard>
        </BeginStoryboard>
      </EventTrigger>
    </Style.Triggers>
  </Style>
</DataGrid.RowStyle>
Run Code Online (Sandbox Code Playgroud)

错误信息: Cannot freeze this Storyboard timeline tree for use across threads.

wpf

1
推荐指数
1
解决办法
2577
查看次数