Я только недавно начал в WPF, и я пытаюсь заменить эффект наведения по умолчанию кнопки, используя стиль, который я сделал.
<Style x:Key="UserType_LoginButton" TargetType="Button">
<Setter Property="OverridesDefaultStyle" Value="True"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Name="border"
BorderBrush="{TemplateBinding BorderBrush}"
Background="{TemplateBinding Background}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="border" Property="BorderBrush" Value="{Binding BorderBrush}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<EventTrigger RoutedEvent="Button.Click">
<BeginStoryboard>
<Storyboard>
<ColorAnimation Storyboard.TargetName="BackgroundGrid" From="Red" To="Blue" Duration="0:0:4" Storyboard.TargetProperty="Background" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Style>
К сожалению, я получаю ошибку:
A value of type 'Event Trigger' cannot be added to a collection or dictionary of type 'SetterBaseCollection'
Как я могу добавить триггер события?