I don't think you can get it to work using ResourceDictionary
. But, using a CompositeCollection
inside a ResourceDictionary
did work:
<CompositeCollection x:Key="Brushes" >
<LinearGradientBrush />
<LinearGradientBrush />
<LinearGradientBrush />
<LinearGradientBrush />
<LinearGradientBrush />
</CompositeCollection>
Then, the XAML to access it looks like this:
<ComboBox ItemsSource="{StaticResource Brushes}" HorizontalContentAlignment="Stretch" SelectedIndex="0">
<ComboBox.ItemTemplate>
<DataTemplate >
<Rectangle Height="20" HorizontalAlignment="Stretch" Fill="{Binding}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>