I am trying to define a StaticResource in an application-level ResourceDictionary, and I am having trouble with the following markup:
<Thickness x:Key="RelativeLayoutPadding"> <Setter Property="Top" Value="15" /> <Setter Property="Bottom" Value="15" /> <Setter Property="Left" Value="15" /> <Setter Property="Right" Value="15" /> </Thickness>
I know the ResourceDictionary works, because it works with other types that I am setting, such as Doubles. However, for this markup, I get the error message that the property "Top" cannot be resolved (with a XamlParse exception). I originally thought this might be because the Thickness structure may not have public static properties for its Top, Bottom, Left, and Right Doubles. However, I have seen sample code for LayoutOptions having its Alignment property defined as a StaticResource and it is unclear from the documentation as to whether or not either the Alignment property or the Top, Bottom, Left, and Right properties are static. All, however, are clearly public, so I don't understand why the Setter class should have any issue in setting these properties. Please provide assistance.