Add behavior to select text on focus
ADD
WalletWasabi.Fluent/Behaviors/TextBoxAutoSelectTextBehavior.cs
+using System.Reactive.Disposables;
+using System.Reactive.Linq;
+using Avalonia.Controls;
+
+namespace WalletWasabi.Fluent.Behaviors;
+
+internal class TextBoxAutoSelectTextBehavior : AttachedToVisualTreeBehavior<TextBox>
+{
+ protected override void OnAttachedToVisualTree(CompositeDisposable disposable)
+ {
+ AssociatedObject?.SelectAll();
+ Observable.FromEventPattern(AssociatedObject, "GotFocus")
+ .Subscribe(_ => AssociatedObject.SelectAll())
+ .DisposeWith(disposable);
+ Observable.FromEventPattern(AssociatedObject, "PointerReleased")
+ .Subscribe(_ => AssociatedObject.SelectAll())
+ .DisposeWith(disposable);;
+ }
+}
\ No newline at end of file

MODIFY
WalletWasabi.Fluent/ViewModels/SearchBar/SearchBarViewModel.cs
WalletWasabi.Fluent/ViewModels/SearchBar/SearchBarViewModel.cs
@@ -38,10 +38,6 @@ public class SearchBarViewModel : ReactiveObject
.Subscribe();
ShowListCommand = ReactiveCommand.Create(() => IsSearchListVisible = true);
-
- this.WhenAnyValue(x => x.IsSearchListVisible)
- .Where(x => x == false)
- .Subscribe(_ => SearchText = "");
}
public ReactiveCommand<Unit, bool> ShowListCommand { get; set; }

MODIFY
WalletWasabi.Fluent/Views/SearchBar/SearchBar.axaml
WalletWasabi.Fluent/Views/SearchBar/SearchBar.axaml
<TextBox x:Name="SearchBox" Watermark="Search settings / advanced features" HorizontalAlignment="Left"
Text="{Binding SearchText, Mode=TwoWay}" Width="400" VerticalAlignment="Center">
+
+ <i:Interaction.Behaviors>
+ <behaviors:TextBoxAutoSelectTextBehavior />
+ </i:Interaction.Behaviors>
+
<TextBox.InnerLeftContent>
<PathIcon Name="LeftIcon" Data="{DynamicResource action_center_regular}" />
</TextBox.InnerLeftContent>
<TextBox.InnerRightContent>
<PathIcon Name="RightIcon" Data="{DynamicResource search_regular}" />
</TextBox.InnerRightContent>
+
</TextBox>
<FlyoutBase.AttachedFlyout>

Add behavior to select text on focus