,我发现了以下错误:XAML:属性 '资源' 设置不止一次
The property 'Resources' is set more than once.
这是我的XAML:
<UserControl.Resources>
<!--Resource dictionaries for framework stuff-->
<ResourceDictionary>
<Style x:Key="MultiLineTextBox" TargetType="TextBox">
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="TextWrapping" Value="WrapWithOverflow"/>
</Style>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/View;component/Common/ResourceDictionary.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
<!--Convertors needed for proper display-->
<c:CollapsedIfNegative x:Key="CollapseIfNegative"/>
<c:VisibleIfNegative x:Key="MakeVisibleIfNegative"/>
<c:ErrorCodeToString x:Key="ConvertErrorCodeToString"/>
</UserControl.Resources>
这有效,但我不明白为什么它需要在中的最后一个元素转换器的问题,但不会成为第一个问题。 –
2010-08-06 19:07:10
在你的例子中,它们根本不在'ResourceDictionary'中。我认为'MergedDictionaries'元素必须是第一个或最后一个,但除此之外,顺序并不重要。 – 2010-08-06 19:33:44
这一句话值得黄金分享:“如果你没有明确地在它的内容上放置一个标签,编译器会神奇地为你呈现一个” - 非常感谢你。 –
2015-09-14 03:11:46