I am new to WPF and using resource dictionaries. I want to create some styles that are accessible to all resource dictionaries but I don't know what is the appropriate way to do that? I also want to know how to use resources in another resource dictionary in a resource dictionary.
You can do this by using Application.Resources
in App.xaml
. Create a Resource Dictionary
where you want to store and just put your your Resource Dictionary
name in the source
of ResourceDictionary
.
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Your Resource Dictionary Name"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>