I am trying to apply global application styles to certain control types, however adding these styles to Application.Resources does is not applying the styles to the elements in my views.
Example:
<Application x:Class="GUI.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Application.Resources>
<Style TargetType="{x:Type TextBox}">
<Setter Property="Background" Value="AliceBlue"></Setter>
<Setter Property="Margin" Value="20,20,20,20"></Setter>
<Setter Property="FontStyle" Value="Italic"></Setter>
</Style>
</Application.Resources>
</Application>
In all the examples I have found for applying application wide styles this has been how they say to do it, however it is not working for me. What am I doing wrong?
Thanks,
Alex.
Worked this out myself woops, the problem is I was not using the
StartUpUriproperty to open my initial application view, I changed my start up process so it does use this property and this has fixed my problem.My App.xaml now looks like this:
Thanks,
Alex.