Use builtin Avalonia.Xaml.Interactions.Custom actions
DELETE
WalletWasabi.Fluent/Behaviors/AddClassAction.cs
-using Avalonia;
-using Avalonia.Xaml.Interactivity;
-
-namespace WalletWasabi.Fluent.Behaviors
-{
- public class AddClassAction : AvaloniaObject, IAction
- {
- public static readonly StyledProperty<string> ClassNameProperty =
- AvaloniaProperty.Register<AddClassAction, string>(nameof(ClassName));
-
- public static readonly StyledProperty<IStyledElement?> StyledElementProperty =
- AvaloniaProperty.Register<AddClassAction, IStyledElement?>(nameof(StyledElement));
-
- public static readonly StyledProperty<bool> RemoveIfExistsProperty =
- AvaloniaProperty.Register<AddClassAction, bool>(nameof(RemoveIfExists));
-
- public string ClassName
- {
- get => GetValue(ClassNameProperty);
- set => SetValue(ClassNameProperty, value);
- }
-
- public IStyledElement? StyledElement
- {
- get => GetValue(StyledElementProperty);
- set => SetValue(StyledElementProperty, value);
- }
-
- public bool RemoveIfExists
- {
- get => GetValue(RemoveIfExistsProperty);
- set => SetValue(RemoveIfExistsProperty, value);
- }
-
- public object Execute(object? sender, object? parameter)
- {
- var target = GetValue(StyledElementProperty) is { } ? StyledElement : sender as IStyledElement;
- if (target is null || string.IsNullOrEmpty(ClassName))
- {
- return false;
- }
-
- if (RemoveIfExists && target.Classes.Contains(ClassName))
- {
- target.Classes.Remove(ClassName);
- }
-
- target.Classes.Add(ClassName);
-
- return true;
- }
- }
-}
\ No newline at end of file

DELETE
WalletWasabi.Fluent/Behaviors/RemoveClassAction.cs
-using Avalonia;
-using Avalonia.Xaml.Interactivity;
-
-namespace WalletWasabi.Fluent.Behaviors
-{
- public class RemoveClassAction : AvaloniaObject, IAction
- {
- public static readonly StyledProperty<string> ClassNameProperty =
- AvaloniaProperty.Register<RemoveClassAction, string>(nameof(ClassName));
-
- public static readonly StyledProperty<IStyledElement?> StyledElementProperty =
- AvaloniaProperty.Register<RemoveClassAction, IStyledElement?>(nameof(StyledElement));
-
- public string ClassName
- {
- get => GetValue(ClassNameProperty);
- set => SetValue(ClassNameProperty, value);
- }
-
- public IStyledElement? StyledElement
- {
- get => GetValue(StyledElementProperty);
- set => SetValue(StyledElementProperty, value);
- }
-
- public object Execute(object? sender, object? parameter)
- {
- var target = GetValue(StyledElementProperty) is { } ? StyledElement : sender as IStyledElement;
- if (target is null || string.IsNullOrEmpty(ClassName))
- {
- return false;
- }
-
- if (target.Classes.Contains(ClassName))
- {
- target.Classes.Remove(ClassName);
- }
-
- return true;
- }
- }
-}
\ No newline at end of file

MODIFY
WalletWasabi.Fluent/Views/HelpAndSupport/AboutView.axaml
WalletWasabi.Fluent/Views/HelpAndSupport/AboutView.axaml
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:i="clr-namespace:Avalonia.Xaml.Interactivity;assembly=Avalonia.Xaml.Interactivity"
xmlns:ia="clr-namespace:Avalonia.Xaml.Interactions.Core;assembly=Avalonia.Xaml.Interactions"
+ xmlns:ic="clr-namespace:Avalonia.Xaml.Interactions.Custom;assembly=Avalonia.Xaml.Interactions"
xmlns:behaviors="using:WalletWasabi.Fluent.Behaviors"
xmlns:vm="using:WalletWasabi.Fluent.ViewModels.HelpAndSupport"
xmlns:controls="using:WalletWasabi.Fluent.Controls"
HorizontalAlignment="Stretch">
<i:Interaction.Behaviors>
<ia:DataTriggerBehavior Binding="{Binding #LinksItemsControl.Bounds.Width}" ComparisonCondition="LessThan" Value="500">
- <behaviors:AddClassAction StyledElement="{Binding #LinksItemsControl}" ClassName="narrow" RemoveIfExists="True"/>
+ <ic:AddClassAction StyledElement="{Binding #LinksItemsControl}" ClassName="narrow" RemoveIfExists="True"/>
</ia:DataTriggerBehavior>
<ia:DataTriggerBehavior Binding="{Binding #LinksItemsControl.Bounds.Width}" ComparisonCondition="GreaterThanOrEqual" Value="500">
- <behaviors:RemoveClassAction StyledElement="{Binding #LinksItemsControl}" ClassName="narrow"/>
+ <ic:RemoveClassAction StyledElement="{Binding #LinksItemsControl}" ClassName="narrow"/>
</ia:DataTriggerBehavior>
</i:Interaction.Behaviors>
<ItemsControl.Styles>

MODIFY
WalletWasabi.Fluent/Views/Wallets/Send/SendFeeView.axaml
WalletWasabi.Fluent/Views/Wallets/Send/SendFeeView.axaml
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:i="clr-namespace:Avalonia.Xaml.Interactivity;assembly=Avalonia.Xaml.Interactivity"
xmlns:ia="clr-namespace:Avalonia.Xaml.Interactions.Core;assembly=Avalonia.Xaml.Interactions"
- xmlns:behaviors="using:WalletWasabi.Fluent.Behaviors"
+ xmlns:ic="clr-namespace:Avalonia.Xaml.Interactions.Custom;assembly=Avalonia.Xaml.Interactions"
xmlns:c="using:WalletWasabi.Fluent.Controls"
xmlns:vm="using:WalletWasabi.Fluent.ViewModels.Wallets.Send"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
</c:LineChart.Styles>
<i:Interaction.Behaviors>
<ia:DataTriggerBehavior Binding="{Binding #GradientLineChart.Bounds.Width}" ComparisonCondition="LessThan" Value="550">
- <behaviors:AddClassAction StyledElement="{Binding #GradientLineChart}" ClassName="narrow" RemoveIfExists="True"/>
+ <ic:AddClassAction StyledElement="{Binding #GradientLineChart}" ClassName="narrow" RemoveIfExists="True"/>
</ia:DataTriggerBehavior>
<ia:DataTriggerBehavior Binding="{Binding #GradientLineChart.Bounds.Width}" ComparisonCondition="GreaterThanOrEqual" Value="550">
- <behaviors:RemoveClassAction StyledElement="{Binding #GradientLineChart}" ClassName="narrow"/>
+ <ic:RemoveClassAction StyledElement="{Binding #GradientLineChart}" ClassName="narrow"/>
</ia:DataTriggerBehavior>
</i:Interaction.Behaviors>
</c:LineChart>

Use builtin Avalonia.Xaml.Interactions.Custom actions