Having lots of styles in App.xaml will quickly become complex, so they can be placed in separate resource dictionaries.
In order to use the dictionary, it must be merged with App.xaml. So, in App.xaml, after the resource dictionary has been created:
<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Class="WPF_Style_Example.App" StartupUri="MainWindow.xaml"> <Application.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="ResourceDictionaries/Dictionary1.xaml"/> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </Application.Resources> </Application>
New styles can now be created in the Dictionary1.xaml and they can be referenced as if they were in App.xaml. After building the project, the option will also appear in Visual Studio when copying a style to locate it in the new resource dictionary.