I have tried to set the Style for WPF Window in XAML. I am able to see my changes in VS Designer, but when I run the application it will always get the default Style.
Not Working:
<Style TargetType="Window">
<Setter Property="Background" Value="Red"/>
</Style>
If I give that Style with Key and applying that Style to Window then it is working.
Working:
<Style x:Key="window" TargetType="Window">
<Setter Property="Background" Value="Red"/>
</Style>
There is any reason need to give Style with key for Window?
Can any one please explain what is going on?