我在 VS 2010 中创建 WPF 项目。在完成功能性 GUI 的工作后,我想在 Blend 4 中编辑控件模板。但是当我在 Blend 中以 DesignMode 打开项目时,他告诉我
无效的 XAML
在结果窗口中他写道:
Windows Presentation Foundation (WPF) 项目不支持 [ControlName]
其中 [ControlName] 是我在项目中使用的默认控件列表(例如 Window、DockPanel 等)
如何避免此问题并能够在 Expression-Blend4 的 DesignMode 下编辑 WPF 表单?
EDIT:
可能的解决方法。
经过对空项目(*.csproj 文件)的一些比较,该项目是由Blend
and by Studio
,我发现VisualStudio
使用下一行创建它:
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
...
而 Blend 使用以下行:
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
所以,如果你改变x86
to AnyCPU
,Blend 将按预期打开项目。
我以前只见过一次这个错误消息。在将新的解决方案文件与无法加载的解决方案文件进行比较后,我发现 Blendrequires the AnyCPU
待定义的平台/配置。
如果这不起作用,请确保您拥有 WPF 项目引用的所有必需程序集:PresentationCore
, PresentationFramework
, and WindowsBase
.
HTH,
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)