Fixed fee slider keyboard behavior
MODIFY
WalletWasabi.Fluent/Behaviors/ExecuteCommandOnKeyDownBehavior.cs
WalletWasabi.Fluent/Behaviors/ExecuteCommandOnKeyDownBehavior.cs
@@ -22,6 +22,9 @@ public class ExecuteCommandOnKeyDownBehavior : AttachedToVisualTreeBehavior<Cont
public static readonly StyledProperty<object> CommandParameterProperty =
AvaloniaProperty.Register<ExecuteCommandOnKeyDownBehavior, object>(nameof(CommandParameter));
+ public static readonly StyledProperty<RoutingStrategies> EventRoutingStrategyProperty =
+ AvaloniaProperty.Register<ExecuteCommandOnKeyDownBehavior, RoutingStrategies>(nameof(EventRoutingStrategy), RoutingStrategies.Bubble);
+
public Key? Key
{
get => GetValue(KeyProperty);
@@ -46,6 +49,12 @@ public class ExecuteCommandOnKeyDownBehavior : AttachedToVisualTreeBehavior<Cont
set => SetValue(CommandParameterProperty, value);
}
+ public RoutingStrategies EventRoutingStrategy
+ {
+ get => GetValue(EventRoutingStrategyProperty);
+ set => SetValue(EventRoutingStrategyProperty, value);
+ }
+
protected override void OnAttachedToVisualTree(CompositeDisposable disposable)
{
var control = AssociatedObject;
@@ -56,7 +65,7 @@ public class ExecuteCommandOnKeyDownBehavior : AttachedToVisualTreeBehavior<Cont
if (control.GetVisualRoot() is IInputElement inputRoot)
{
- inputRoot.AddDisposableHandler(InputElement.KeyDownEvent, RootDefaultKeyDown)
+ inputRoot.AddDisposableHandler(InputElement.KeyDownEvent, RootDefaultKeyDown, EventRoutingStrategy)
.DisposeWith(disposable);
}
}

MODIFY
WalletWasabi.Fluent/Views/Wallets/Send/SendFeeView.axaml
WalletWasabi.Fluent/Views/Wallets/Send/SendFeeView.axaml
</Style>
</Slider.Styles>
<i:Interaction.Behaviors>
- <behaviors:ExecuteCommandOnKeyDownBehavior Command="{Binding MoveSliderRightCommand}" IsEnabled="{Binding #SendFeeView.DataContext.IsActive}" x:CompileBindings="False" Key="Right"/>
- <behaviors:ExecuteCommandOnKeyDownBehavior Command="{Binding MoveSliderLeftCommand}" IsEnabled="{Binding #SendFeeView.DataContext.IsActive}" x:CompileBindings="False" Key="Left"/>
+ <behaviors:ExecuteCommandOnKeyDownBehavior Command="{Binding MoveSliderRightCommand}" IsEnabled="{Binding #SendFeeView.DataContext.IsActive}" x:CompileBindings="False" Key="Right" EventRoutingStrategy="Tunnel"/>
+ <behaviors:ExecuteCommandOnKeyDownBehavior Command="{Binding MoveSliderLeftCommand}" IsEnabled="{Binding #SendFeeView.DataContext.IsActive}" x:CompileBindings="False" Key="Left" EventRoutingStrategy="Tunnel"/>
</i:Interaction.Behaviors>
</Slider>
<c:LineChart Classes="cursor border xAxis yAxis xAxisLabels yAxisLabels xAxisTitle yAxisTitle area"

Fixed fee slider keyboard behavior