trigger autocopy when the focus is somewhere inside the dialog
DELETE
WalletWasabi.Fluent/Behaviors/ExecuteCommandOnClickBehavior.cs
-using System.Windows.Input;
-using Avalonia;
-using Avalonia.Controls;
-using Avalonia.Input;
-
-namespace WalletWasabi.Fluent.Behaviors
-{
- public class ExecuteCommandOnClickBehavior : AttachedToVisualTreeBehavior<Control>
- {
- public static readonly StyledProperty<ICommand?> CommandProperty =
- AvaloniaProperty.Register<ExecuteCommandOnClickBehavior, ICommand?>(nameof(Command));
-
- public ICommand? Command
- {
- get => GetValue(CommandProperty);
- set => SetValue(CommandProperty, value);
- }
-
- protected override void OnAttachedToVisualTree()
- {
- AssociatedObject.PointerReleased += OnPointerReleased;
- }
-
- protected override void OnDetaching()
- {
- base.OnDetaching();
-
- AssociatedObject.PointerReleased -= OnPointerReleased;
- }
-
- private void OnPointerReleased(object? sender, PointerReleasedEventArgs e)
- {
- Command?.Execute(default);
- }
- }
-}

ADD
WalletWasabi.Fluent/Behaviors/ExecuteCommandOnFocusWithin.cs
+using System;
+using System.Reactive.Disposables;
+using System.Reactive.Linq;
+using System.Windows.Input;
+using Avalonia;
+using Avalonia.Controls;
+using ReactiveUI;
+
+namespace WalletWasabi.Fluent.Behaviors
+{
+ public class ExecuteCommandOnFocusWithin : DisposingBehavior<Control>
+ {
+ public static readonly StyledProperty<ICommand?> CommandProperty =
+ AvaloniaProperty.Register<ExecuteCommandOnFocusWithin, ICommand?>(nameof(Command));
+
+ public ICommand? Command
+ {
+ get => GetValue(CommandProperty);
+ set => SetValue(CommandProperty, value);
+ }
+
+ protected override void OnAttached(CompositeDisposable disposables)
+ {
+ AssociatedObject?.WhenAnyValue(x => x.IsKeyboardFocusWithin)
+ .Where(x => x)
+ .Subscribe(_ => Command?.Execute(default))
+ .DisposeWith(disposables);
+ }
+ }
+}

MODIFY
WalletWasabi.Fluent/Views/Wallets/Send/SendView.axaml
WalletWasabi.Fluent/Views/Wallets/Send/SendView.axaml
x:DataType="vm:SendViewModel"
x:CompileBindings="True"
x:Class="WalletWasabi.Fluent.Views.Wallets.Send.SendView">
+ <i:Interaction.Behaviors>
+ <behaviors:ExecuteCommandOnFocusWithin Command="{Binding AutoPasteCommand}" />
+ </i:Interaction.Behaviors>
<c:ContentArea Title="Send" Caption=""
EnableBack="{Binding EnableBack}"
EnableNext="True"
Watermark="(e.g. Bitcoin address or PayJoin URL)">
<i:Interaction.Behaviors>
<behaviors:FocusOnAttachedBehavior />
- <behaviors:ExecuteCommandOnClickBehavior Command="{Binding AutoPasteCommand}" />
</i:Interaction.Behaviors>
<TextBox.InnerRightContent>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Spacing="10" Margin="10 0">

trigger autocopy when the focus is somewhere inside the dialog