How to point one resource (a SolidColorBrush) at another

I agree with what Rachel said, but if you have to base it on an existing SolidColorBrush, you can do it with the following: <SolidColorBrush x:Key=”MyDataGridHeaderBrush” Color=”{Binding Source={StaticResource HeaderBrushDefinedElsewhere}, Path=Color}”/> Note this just works for the “Color” attribute, you’d have to do it separately for each attribute you needed.

Specify width/height as resource in WPF

Sure. <Page xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation” xmlns:sys=”clr-namespace:System;assembly=mscorlib” xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml”> <Page.Resources> <sys:Double x:Key=”Height”>200</sys:Double> <sys:Double x:Key=”Width”>200</sys:Double> </Page.Resources> <Grid> <Rectangle Height=”{StaticResource Height}” Width=”{StaticResource Width}” Fill=”Blue”/> </Grid> </Page>

Trouble referencing a Resource Dictionary that contains a Merged Dictionary

Answered a similar question here earlier, see Adding a Merged Dictionary to a Merged Dictionary question. This is an optimization bug, see Microsoft Connect / DefaultStyleKey style not found in inner MergedDictionaries: On the creation of every object in XAML, if a default style is present (i.e. style w/ a key of Type) that style … Read more

Load WPF styles or other Static Resources from an external file or assembly

Referencing an external ResourceDictionary (XAML File): <Application.Resources> <ResourceDictionary Source=”MyResources.xaml” /> </Application.Resources> Referencing an external ResourceDictionary (DLL): <Application.Resources> <ResourceDictionary Source=”/MyExternalAssembly;component/MyResources.xaml” /> </Application.Resources>

tech