This is my first serious WPF application. So far there's nothing but a label on the main form.
I got the ShinyRed.xaml theme from here. I followed the instructions on the site (and on several other sites) but could not get the theme to apply to the Label control.
How do I get this style to work? Am I right in my understanding - that I can point to this style xaml and it will automatically be applied as the default style for all controls?
Styles are always applied by default if they are specified as a resource using a TargetType
. If they are placed in the Application.Resources however they will apply even inside Templates which is not the case otherwise. To use a theme you can just reference it in App.xaml
:
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Themes/ShinyRed.xaml"/>
</ResourceDictionary.MergedDictionaries>
<!-- Other app resources here -->
</ResourceDictionary>
</Application.Resources>
See the Resouces Overview on MSDN for more info.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With