I have five buttons like this:
<Button Name="btnAssets" Grid.Row="1" Margin="7,1,7,1" Click="btnDrawer_Click" >
<StackPanel >
<StackPanel.Background>
<ImageBrush ImageSource="/Test;component/Images/DrawerSlid.png" />
</StackPanel.Background>
<Image Margin="0,0,0,0" Source="/Test;component/Images/DrawerUpper2.png" />
<TextBlock Margin="0,10,0,10" TextWrapping="WrapWithOverflow" TextAlignment="Center">Assets</TextBlock>
<Image Margin="0,0,0,0" Source="/Test;component/Images/DrawerSlid2.png" />
</StackPanel>
</Button>
And style trigger for these buttons like this:
<Style TargetType="StackPanel">
<Setter Property= "TextBlock.Foreground" Value="White"/>
<Setter Property= "TextBlock.FontSize" Value="12"/>
<Style.Triggers>
<Trigger Property ="IsMouseOver" Value="True">
<Setter Property= "TextBlock.Foreground" Value="Yellow"/>
<Setter Property= "TextBlock.FontSize" Value="13"/>
</Trigger>
</Style.Triggers>
</Style>
These code works fine. Now I want that When user clicks on any of Button its Foreground color and Font size should be changed. But I can not find any easy solution. How can do this is via xaml or via c#?