我有一个csproj覆盖的新式项目文件IntermediateOutputPath.它看起来像这样:
<PropertyGroup>
<TargetFramework>netstandard1.6</TargetFramework>
<IntermediateOutputPath>new\path\to\obj</IntermediateOutputPath>
</PropertyGroup>
Run Code Online (Sandbox Code Playgroud)
问题是,我的Visual Studio扩展无法访问IntermediateOutputPath属性.Project.Properties与旧的项目格式相比,似乎有更少的东西.
我也尝试project.ConfigurationManager.ActiveConfiguration.Properties过类似的成功.
有没有办法从Visual Studio扩展中获取此信息?
是否可以枚举程序集中定义的所有XAML资源?如果你有可用的密钥,我知道如何检索资源,但在我的情况下并非如此.
编辑:似乎我不够清楚.我想列出在我知道完整路径的外部程序集中定义的XAML资源.
我有一个应该捕获KeyDown/KeyUp事件的表单.
此代码因NRE而失败,因为它在我当前视图中查找KeyDown控件:
this.BindCommand(ViewModel, vm => vm.KeyDown, "KeyDown");
Run Code Online (Sandbox Code Playgroud)
我所做的是创建了包装类,它具有作为属性的形式,所以我可以使用这个重载:
this.BindCommand(ViewModel, vm => vm.KeyDown, v => v.Form, "KeyDown");
Run Code Online (Sandbox Code Playgroud)
虽然它有效但对我来说似乎是一个黑客.有没有正确的方法来绑定本地事件?