,我發現了以下錯誤: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