Hi, you can use the same Style-resource for Background in DataTemplate and in other regions, lik ein following demo:
<Window x:Class="Window021"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfApp1.WpfApp021"
mc:Ignorable="d"
Title="Window021" Height="450" Width="815">
<Window.DataContext>
<local:ViewModel/>
</Window.DataContext>
<Window.Resources>
<Style x:Key="BG" TargetType="Panel">
<Setter Property="Background" Value="Red"/>
</Style>
</Window.Resources>
<Grid Style="{StaticResource BG}">
<ScrollViewer x:Name="Grid" >
<ItemsControl ItemsSource="{Binding Categories}" Background="Green" Margin="50">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Orientation="Horizontal" VerticalAlignment="Top" Width="{Binding ElementName=Grid, Path=ActualWidth}" Margin="0,0,0,20"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel Margin="10" Style="{StaticResource BG}">
<Button Width="150" Height="120" HorizontalAlignment="Left"
VerticalAlignment="Top" CommandParameter="{Binding CategoryId}"
Background="Transparent">
<TextBlock Text="{Binding CategoryName}" TextWrapping="Wrap" TextAlignment="Center" Margin="10"/>
</Button>
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</Grid>