I have this XAML. If I remove the StackPanel.Resources section I get the styles that were defined at the application level. If I leave it in, then I only get the new styles.
How to I make it combine both the local and global styles?
<Window x:Class="MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<DockPanel>
<StackPanel DockPanel.Dock="Top" Orientation="Horizontal" >
<StackPanel.Resources>
<Style TargetType="TextBlock" >
<Setter Property="Margin" Value="4" />
</Style>
<Style TargetType="Button" >
<Setter Property="Margin" Value="4" />
</Style>
</StackPanel.Resources>
<Border Padding="5" BorderBrush="Blue" BorderThickness="4" >
<StackPanel>
<TextBlock>Applications</TextBlock>
<Button>Open Issues</Button>
<Button>Services</Button>
</StackPanel>
</Border>
</StackPanel>
<StackPanel></StackPanel>
</DockPanel>
</Window>
In case it helps, this is how I defined the globla styles.
<Application x:Class="Application"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary Source="ShinyBlue.xaml"/>
</Application.Resources>
</Application>