Use EventTriggerBehavior
MODIFY
WalletWasabi.Fluent/Controls/AnimatedButton.axaml
WalletWasabi.Fluent/Controls/AnimatedButton.axaml
Command="{TemplateBinding Command}"
CommandParameter="{TemplateBinding CommandParameter}"
Classes="plain">
+ <i:Interaction.Behaviors>
+ <ia:EventTriggerBehavior EventName="Click">
+ <ia:ChangePropertyAction TargetObject="{Binding RelativeSource={RelativeSource TemplatedParent}}" PropertyName="AnimateIcon" Value="False"/>
+ <ia:ChangePropertyAction TargetObject="{Binding RelativeSource={RelativeSource TemplatedParent}}" PropertyName="AnimateIcon" Value="True"/>
+ </ia:EventTriggerBehavior>
+ </i:Interaction.Behaviors>
<Panel>
<PathIcon Name="PART_IconNormal"
Classes.hideAndShow="{TemplateBinding AnimateIcon}"

MODIFY
WalletWasabi.Fluent/Controls/AnimatedButton.axaml.cs
WalletWasabi.Fluent/Controls/AnimatedButton.axaml.cs
@@ -74,31 +74,5 @@ namespace WalletWasabi.Fluent.Controls
get => GetValue(AnimateIconProperty);
set => SetValue(AnimateIconProperty, value);
}
-
- protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
- {
- base.OnApplyTemplate(e);
-
- _compositeDisposable?.Dispose();
-
- _compositeDisposable = new CompositeDisposable();
-
- var button = e.NameScope.Find<Button>("PART_Button");
-
- button.Click += ButtonOnClick;
-
- Disposable.Create(
- () =>
- {
- button.Click -= ButtonOnClick;
- })
- .DisposeWith(_compositeDisposable);
- }
-
- private void ButtonOnClick(object? sender, RoutedEventArgs e)
- {
- AnimateIcon = false;
- AnimateIcon = true;
- }
}
}
\ No newline at end of file

Use EventTriggerBehavior