【发布时间】:2009-02-26 09:15:38
【问题描述】:
在 VisualStudio 2008 中,设计界面只是空的,因为我将此样式添加到 App.xaml:
<Style x:Key="RightAlignedCell" TargetType="data:DataGridCell">
<Style.Setters>
<Setter Property="HorizontalContentAlignment" Value="Right" />
</Style.Setters>
</Style>
并在顶部添加这个必需的命名空间以使 data: 可解析
xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"
运行 Silverlight 应用程序时,一切正常。然而,设计表面是空的,我在编辑 xaml 时出现了这个错误:
无效的属性值 数据:DataGridCell 用于属性 目标类型
如前所述,这个错误只是在设计时发生的。编译工作完美。我做错了什么,为什么设计者不能正确解析这个命名空间?
更新:另外,当我将样式从 App.xaml 移动到 Page.xaml 时,设计师再次工作。有什么想法吗?
【问题讨论】:
标签: silverlight namespaces app.xaml design-surface