revert stuff and try using tagsbox with gestures....
ADD
WalletWasabi.Fluent/Behaviors/FocusBehavior.cs
+using System;
+using System.Reactive.Disposables;
+using Avalonia;
+using Avalonia.Controls;
+using Avalonia.Data;
+using Avalonia.Xaml.Interactivity;
+
+namespace WalletWasabi.Fluent.Behaviors
+{
+ internal class FocusBehavior : DisposingBehavior<Control>
+ {
+ public static readonly StyledProperty<bool> IsFocusedProperty =
+ AvaloniaProperty.Register<FocusBehavior, bool>(nameof(IsFocused), defaultBindingMode: BindingMode.TwoWay);
+
+ public bool IsFocused
+ {
+ get => GetValue(IsFocusedProperty);
+ set => SetValue(IsFocusedProperty, value);
+ }
+
+ protected override void OnAttached(CompositeDisposable disposables)
+ {
+ base.OnAttached();
+
+ if (AssociatedObject != null)
+ {
+ AssociatedObject.AttachedToLogicalTree += (sender, e) =>
+ disposables.Add(this.GetObservable(IsFocusedProperty)
+ .Subscribe(focused =>
+ {
+ if (focused)
+ {
+ AssociatedObject.Focus();
+ }
+ }));
+ }
+ }
+ }
+}
\ No newline at end of file

DELETE
WalletWasabi.Fluent/Behaviors/FocusTargetViaBoolean.cs
-using Avalonia;
-using Avalonia.Controls;
-using Avalonia.LogicalTree;
-using ReactiveUI;
-using System;
-using System.Reactive.Disposables;
-using System.Reactive.Linq;
-
-namespace WalletWasabi.Fluent.Behaviors
-{
- public class FocusTargetViaBoolean : DisposingBehavior<Control>
- {
- public static readonly StyledProperty<bool> GotFocusedProperty =
- AvaloniaProperty.Register<FocusTargetViaBoolean, bool>(nameof(GotFocused));
-
- public bool GotFocused
- {
- get => GetValue(GotFocusedProperty);
- set => SetValue(GotFocusedProperty, value);
- }
-
- protected override void OnAttached(CompositeDisposable disposables)
- {
- this.WhenAnyValue(x => x.GotFocused)
- .Where(x => x)
- .Subscribe(_ => AssociatedObject?.Focus())
- .DisposeWith(disposables);
- }
- }
-}
\ No newline at end of file

MODIFY
WalletWasabi.Fluent/Controls/ContentArea.axaml
WalletWasabi.Fluent/Controls/ContentArea.axaml
<Button Name="PART_NextButton" Classes="action" IsVisible="{TemplateBinding EnableNext}" Content="{TemplateBinding NextContent}" Margin="10,10,0,10" HorizontalAlignment="Right" Command="{Binding NextCommand}">
<i:Interaction.Behaviors>
<behaviors:FocusOnAttachedBehavior IsEnabled="{Binding FocusNext, RelativeSource={RelativeSource TemplatedParent}}" />
- <behaviors:FocusTargetViaBoolean GotFocused="{Binding FocusNextOnCanExecute, RelativeSource={RelativeSource TemplatedParent}}" />
</i:Interaction.Behaviors>
</Button>
</Panel>

MODIFY
WalletWasabi.Fluent/Controls/ContentArea.axaml.cs
WalletWasabi.Fluent/Controls/ContentArea.axaml.cs
@@ -33,9 +33,6 @@ namespace WalletWasabi.Fluent.Controls
public static readonly StyledProperty<object> NextContentProperty =
AvaloniaProperty.Register<ContentArea, object>(nameof(NextContent), "Next");
- public static readonly StyledProperty<bool> FocusNextOnCanExecuteProperty =
- AvaloniaProperty.Register<ContentArea, bool>(nameof(FocusNextOnCanExecute));
-
private IContentPresenter? _titlePresenter;
private IContentPresenter? _captionPresenter;
@@ -93,12 +90,6 @@ namespace WalletWasabi.Fluent.Controls
set => SetValue(NextContentProperty, value);
}
- public bool FocusNextOnCanExecute
- {
- get => GetValue(FocusNextOnCanExecuteProperty);
- set => SetValue(FocusNextOnCanExecuteProperty, value);
- }
-
protected override bool RegisterContentPresenter(IContentPresenter presenter)
{
var result = base.RegisterContentPresenter(presenter);

MODIFY
WalletWasabi.Fluent/Controls/TagsBox.xaml.cs
WalletWasabi.Fluent/Controls/TagsBox.xaml.cs
@@ -89,14 +89,12 @@ namespace WalletWasabi.Fluent.Controls
return;
}
- _autoCompleteBox.KeyUp += OnKeyUp;
_autoCompleteBox.TextChanged += OnTextChanged;
_autoCompleteBox.DropDownClosed += OnDropDownClosed;
Disposable.Create(
() =>
{
- _autoCompleteBox.KeyUp -= OnKeyUp;
_autoCompleteBox.TextChanged -= OnTextChanged;
_autoCompleteBox.DropDownClosed -= OnDropDownClosed;
})
@@ -106,6 +104,10 @@ namespace WalletWasabi.Fluent.Controls
.AddDisposableHandler(TextInputEvent, OnTextInput, RoutingStrategies.Tunnel)
.DisposeWith(_compositeDisposable);
+ _autoCompleteBox
+ .AddDisposableHandler(KeyUpEvent, OnKeyUp, RoutingStrategies.Tunnel)
+ .DisposeWith(_compositeDisposable);
+
if (_isFocused)
{
Dispatcher.UIThread.Post(

MODIFY
WalletWasabi.Fluent/Views/RecoverWallet/RecoverWalletView.axaml
WalletWasabi.Fluent/Views/RecoverWallet/RecoverWalletView.axaml
x:DataType="recoverWallet:RecoverWalletViewModel"
x:CompileBindings="True"
x:Class="WalletWasabi.Fluent.Views.RecoverWallet.RecoverWalletView">
+ <UserControl.KeyBindings>
+ <KeyBinding Gesture="Enter" Command="{Binding NextCommand}" />
+ </UserControl.KeyBindings>
<c:ContentArea x:Name="RecoveryPageRoot"
Title="Enter recovery words" Caption="Type in your 12 recovery words and click continue"
- EnableBack="True" FocusNextOnCanExecute="{Binding FinishCommandCanExecute}"
+ EnableBack="True"
EnableCancel="True" CancelContent="Cancel"
EnableNext="True" NextContent="Finish">
<StackPanel>

revert stuff and try using tagsbox with gestures....