Fee Slider - Move left and right with keyboard arrows
ADD
WalletWasabi.Fluent/Behaviors/ExecuteCommandOnKeyDownBehavior.cs
+using System.Reactive.Disposables;
+using System.Windows.Input;
+using Avalonia;
+using Avalonia.Controls;
+using Avalonia.Input;
+using Avalonia.VisualTree;
+
+namespace WalletWasabi.Fluent.Behaviors;
+
+public class ExecuteCommandOnKeyDownBehavior : AttachedToVisualTreeBehavior<Control>
+{
+ public static readonly StyledProperty<Key?> KeyProperty =
+ AvaloniaProperty.Register<ButtonExecuteCommandOnKeyDownBehavior, Key?>(nameof(Key));
+
+ public static readonly StyledProperty<bool> IsEnabledProperty =
+ AvaloniaProperty.Register<ButtonExecuteCommandOnKeyDownBehavior, bool>(nameof(IsEnabled), true);
+
+ public static readonly StyledProperty<ICommand> CommandProperty =
+ AvaloniaProperty.Register<ExecuteCommandOnKeyDownBehavior, ICommand>(nameof(Command));
+
+ public static readonly StyledProperty<object> CommandParameterProperty =
+ AvaloniaProperty.Register<ExecuteCommandOnKeyDownBehavior, object>(nameof(CommandParameter));
+
+ public Key? Key
+ {
+ get => GetValue(KeyProperty);
+ set => SetValue(KeyProperty, value);
+ }
+
+ public bool IsEnabled
+ {
+ get => GetValue(IsEnabledProperty);
+ set => SetValue(IsEnabledProperty, value);
+ }
+
+ public ICommand Command
+ {
+ get => GetValue(CommandProperty);
+ set => SetValue(CommandProperty, value);
+ }
+
+ public object CommandParameter
+ {
+ get => GetValue(CommandParameterProperty);
+ set => SetValue(CommandParameterProperty, value);
+ }
+
+ protected override void OnAttachedToVisualTree(CompositeDisposable disposable)
+ {
+ var control = AssociatedObject;
+ if (control is null)
+ {
+ return;
+ }
+
+ if (control.GetVisualRoot() is IInputElement inputRoot)
+ {
+ inputRoot.AddHandler(InputElement.KeyDownEvent, RootDefaultKeyDown);
+
+ disposable.Add(Disposable.Create(() => inputRoot.RemoveHandler(InputElement.KeyDownEvent, RootDefaultKeyDown)));
+ }
+ }
+
+ private void RootDefaultKeyDown(object? sender, KeyEventArgs e)
+ {
+ var control = AssociatedObject;
+ if (control is null)
+ {
+ return;
+ }
+
+ if (Key is { } && e.Key == Key && control.IsVisible && control.IsEnabled && IsEnabled)
+ {
+ if (!e.Handled && Command.CanExecute(CommandParameter) == true)
+ {
+ Command.Execute(CommandParameter);
+ e.Handled = true;
+ }
+ }
+ }
+}
\ No newline at end of file

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/FeeChartViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/FeeChartViewModel.cs
@@ -6,6 +6,7 @@ using ReactiveUI;
using WalletWasabi.Fluent.Helpers;
using WalletWasabi.Fluent.MathNet;
using WalletWasabi.Fluent.Converters;
+using System.Windows.Input;
namespace WalletWasabi.Fluent.ViewModels.Wallets.Send;
@@ -41,8 +42,14 @@ public partial class FeeChartViewModel : ViewModelBase
this.WhenAnyValue(x => x.SliderValue)
.Subscribe(SetXAxisCurrentValue);
+
+ MoveSliderRightCommand = ReactiveCommand.Create(() => SliderValue -= 10);
+ MoveSliderLeftCommand = ReactiveCommand.Create(() => SliderValue += 10);
}
+ public ICommand MoveSliderRightCommand { get; }
+ public ICommand MoveSliderLeftCommand { get; }
+
private void UpdateFeeAndEstimate(double confirmationTarget)
{
CurrentSatoshiPerByte = GetSatoshiPerByte(confirmationTarget);

MODIFY
WalletWasabi.Fluent/Views/Wallets/Send/SendFeeView.axaml
WalletWasabi.Fluent/Views/Wallets/Send/SendFeeView.axaml
xmlns:behaviors="clr-namespace:WalletWasabi.Fluent.Behaviors"
xmlns:c="using:WalletWasabi.Fluent.Controls"
xmlns:vm="using:WalletWasabi.Fluent.ViewModels.Wallets.Send"
+ xmlns:sys="clr-namespace:System;assembly=System.Runtime"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:CompileBindings="True"
x:DataType="vm:SendFeeViewModel"
<Setter Property="ToolTip.HorizontalOffset" Value="-30" />
</Style>
</Slider.Styles>
+ <i:Interaction.Behaviors>
+ <behaviors:ExecuteCommandOnKeyDownBehavior Command="{Binding MoveSliderRightCommand}" Key="Right"/>
+ <behaviors:ExecuteCommandOnKeyDownBehavior Command="{Binding MoveSliderLeftCommand}" Key="Left"/>
+ </i:Interaction.Behaviors>
</Slider>
<c:LineChart Classes="cursor border xAxisLabels yAxis yAxisLabels yAxisTitle area"
XAxisLabels="{Binding ConfirmationTargetLabels}"

Fee Slider - Move left and right with keyboard arrows