As I read: http://msdn.microsoft.com/en-us/library/cc903952(VS.95).aspx, specifically the section labeled "Forward References With a ResourceDictionary":
Static resource references from within any given resource dictionary must reference a resource that has already been defined lexically before the resource reference. Forward references cannot be resolved by a static resource reference. For this reason, if you use static resource references, you must design your resource dictionary structure such that resources intended for further by-resource use are defined at or near the beginning of each respective resource dictionary.
Does this mean that I cannot do something like this in my App.xaml:
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Assets/Colors.xaml"/>
<ResourceDictionary Source="Assets/Brushes.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
Where Brushes.xaml contains SolidColorBrush, LinearColorBrush, etc, definitions that refer to the colors defined in Colors.xaml ?
e.g.
<SolidColorBrush x:Key="OrangeRedBrush" Color="{StaticResource AppOrangeRed}"/>
?
I define my colors in Colors.xaml like:
<Color x:Key="AppOrangeRed">#FFBF3C1F</Color>
I'm getting a runtime error that states it cannot find a resource with key 'AppOrangeRed' for instance.
What are the best practices for organizing Colors and Brushes so they can be reused (were appropriate, and I understand that colors are structs and brushes are reference objects, explained in http://weblogs.manas.com.ar/spalladino/2009/03/02/silverlight-xaml-guidelines/)
Thanks Rob