How to apply styles to all windows in WPF app?
- by Brandon
I have the following App.xaml file:
<Application x:Class="MiniDeviceConfig.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MiniDeviceConfig.xaml">
<Application.Resources>
    <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
            <ResourceDictionary Source="Button.xaml"/>
            <ResourceDictionary Source="CheckBox.xaml"/>
            <ResourceDictionary Source="ComboBox.xaml"/>
            <ResourceDictionary Source="Common.xaml"/>
            <ResourceDictionary Source="GroupBox.xaml"/>
            <ResourceDictionary Source="Label.xaml"/>
            <ResourceDictionary Source="LinkButton.xaml"/>
            <ResourceDictionary Source="ListBox.xaml"/>
            <ResourceDictionary Source="ListView.xaml"/>
            <ResourceDictionary Source="RadioButton.xaml"/>
            <ResourceDictionary Source="Tooltip.xaml"/>
            <ResourceDictionary Source="Window.xaml"/>
        </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
</Application.Resources>
In my application, my main window is MiniDeviceConfig.xaml (as seen above).  In my Button.xaml file, I clearly set the button height to some obscene number.  And, this size is reflected in my main window's buttons.  However, some action on the main window triggers a modal window that has more buttons on it.  I was expecting the same tall buttons but no such luck.  How do I get the style to propagate into all windows in the application?