Then just add the Style
to your App.Xaml
or your Theme.xaml
(if you have one) or even your Window.Resources
if you just have 1 Window
, just make sure you don't set the x:Key
Example:
This will apply to all TextBoxes
(no x:Key)
<Style TargetType="{x:Type TextBox}">
<Setter Property="Foreground" Value="Red" />
</Style>
TextBoxes will have to use Style="{StaticResource MyStyle}"
to use this :
<Style x:Key="MyStyle" TargetType="{x:Type TextBox}">
<Setter Property="Foreground" Value="Red" />
</Style>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…