I have a StackPanel that I style for MouseOver and PreviewMouseLeftButtonDown. In PreviewMouseLeftButtonDown I change Background color of said StackPanel. But whenever I move my mouse out the color returns to default one, I would like to have my StackPanel function as a Tab header
How can I change color of StackPanel so that It doesnt change OnMouseOut and stays that way?
<Setter Property="Background" Value="#2c2d2f"></Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="White"></Setter>
</Trigger>
<EventTrigger RoutedEvent="PreviewMouseLeftButtonDown">
<BeginStoryboard>
<Storyboard>
<ColorAnimation Storyboard.TargetProperty="(StackPanel.Background).(SolidColorBrush.Color)" To="CadetBlue"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Style.Triggers>