For some reason, I can't find why my generic.xaml
does not override default style.
Everything is contains in a Themes
folder and Styles
are still available via intellisense but I must set them manually on each controls, for example here on a ComboBox
<ComboBox
Style="{StaticResource ComboBoxBase}"
ItemContainerStyle="{StaticResource ComboBoxItemBase}"
/>
My Generic.xaml
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="ComboBox.xaml"/>
<!--other resources goes here-->
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
My App.xaml
<Application.Resources>
<ResourceDictionary Source="Themes/Generic.xaml"/>
</Application.Resources>
Part of the ResourceDictionary for the ComboBox :
<Style x:Key="ComboBoxBase" TargetType="{x:Type ComboBox}">
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="Template">
<!--other setters goes here-->
I wish I could have my Themes
to be default everywhere.
thx