This is a style I apply to all the textblocks in the project which is in the App.XAML file.
<Style TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="Orange" />
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Left"/>
</Style>
But this style changes the Foreground colour of all my menu items and the buttons in my project, even if I specify the foreground color to these controls as black. Any solution to this issue?
My XAML for buttons is below:
<Button x:Name="BtnEdit" Content="Details" Click="BtnEdit_Click" Margin="10,0,0,0" />
Move your style from App.xaml App.Resources to MainWindow.xaml Window.Resources.
If you need your style in more than one window or page then move it to a separate resource dictionary xaml file (add -> new -> wfp -> resource dictionary) as per this article:
resource dictionarys
Merge the dictionary into the Window.Resources not the Application.Resources as in the example! eg