How to implement event triggered WPF control style change
问题 I have an style template for my Button control that looks like that: <Style x:Key="myBtnStyle" TargetType="{x:Type Button}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type Button}"> <Border x:Name="border" Width="100" Height="25" Padding="5,5,5,5" CornerRadius="5,5,5,5" Background="LightGray" BorderBrush="Black" BorderThickness="1,1,1,1"> <ContentPresenter x:Name="cpButton" VerticalAlignment="Center" HorizontalAlignment="Center" Width="Auto" Height="Auto"