我嘗試在resourcedictionary中保存邊距值。類似的東西:Silverlight:在ResourceDictionary中使用邊距
的xmlns:systemwindows = 「CLR-名稱空間:System.Windows;裝配= System.Windows.dll中」[...] 0,2,2,0
<systemwindows:Thickness x:Key="DefaultMarginThickness">0,2,2,0</systemwindows:Thickness>
後來我應該可以做這樣的事情:
<Style TargetType="TextBlock">
<Setter Property="Margin" Value="{StaticResource DefaultMarginThickness}" />
</Style>
但是當我編譯的種源字典我得到:
錯誤1標籤「厚度」的XML命名空間「CLR的命名空間不存在:S ystem.Windows;裝配= System.Windows.dll中」。 \ XAML \ Style.Common.Values.xaml
錯誤2找不到類型'systemwindows:Thickness'。驗證您是否缺少程序集引用,並且所有引用的程序集都已構建。 \ XAML \ Style.Common.Values.xaml
在http://msdn.microsoft.com/en-us/library/system.windows.thickness%28v=vs.95%29.aspx你可以看到System.Windows應該是正確的命名空間。爲什麼他沒有找到課堂厚度?
問候