【发布时间】:2011-07-21 12:02:33
【问题描述】:
我在 VS 2010 中创建我的 WPF 项目。在完成功能 GUI 的工作后,我想在 Blend 4 中编辑我的控件模板。但是当我在 Blend 中打开项目时,在 DesignMode 中,他告诉我
XAML 无效
他在结果窗口中写道:
[ControlName] 在 Windows Presentation Foundation (WPF) 项目中不受支持
其中 [ControlName] 是我在项目中使用的默认控件列表(例如 Window、DockPanel 等)
如何避免此问题并能够在 Expression-Blend4 的 DesignMode 下编辑 WPF 表单?
编辑:
可能的解决方法。
在比较了Blend和Studio创建的空项目(*.csproj文件)后,我发现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 将按预期打开项目。
【问题讨论】:
标签: wpf visual-studio-2010 projects-and-solutions expression-blend-4