我在 VS 2010 中创建我的 WPF 项目。在完成功能 GUI 的工作后,我想在 Blend 4 中编辑我的控件模板。但是当我在 Blend 中打开项目时,在 DesignMode 中,他告诉我
无效的 XAML
在结果窗口中,他写道:
Windows Presentation Foundation (WPF) 项目不支持 [ControlName]
其中 [ControlName] 是我在项目中使用的默认控件列表(例如 Window、DockPanel 等)
如何避免此问题并能够在 Expression-Blend4 的 DesignMode 编辑 WPF 表单?
编辑:
可能的解决方法。
Blend
在比较了由和创建的空项目(* .csproj 文件)之后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
为AnyCPU
,Blend 将按预期打开项目。