i try to save an margin value in a resourcedictionary. Something like that:
xmlns:systemwindows=”clr-namespace:System.Windows;assembly=System.Windows.dll” […]
0,2,2,0
<systemwindows:Thickness x:Key="DefaultMarginThickness">0,2,2,0</systemwindows:Thickness>
Later i should be able to do something like that:
<Style TargetType="TextBlock">
<Setter Property="Margin" Value="{StaticResource DefaultMarginThickness}" />
</Style>
But when i compile the resouce dictionary i get:
Error 1 The tag ‘Thickness’ does not exist in XML namespace ‘clr-namespace:System.Windows;assembly=System.Windows.dll’. \XAML\Style.Common.Values.xaml
Error 2 The type ‘systemwindows:Thickness’ was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. \XAML\Style.Common.Values.xaml
At http://msdn.microsoft.com/en-us/library/system.windows.thickness%28v=vs.95%29.aspx you can see that System.Windows should be the right namespace. Why isnt he finding the Class Thickness?
greetings
If you create a resource dictionary with Visual Studio, the default namespace is mapped such that you do not need a prefix before
Thickness:i.e. the URL
"http://schemas.microsoft.com/winfx/2006/xaml/presentation"maps to the System.Windows namespace.