focus textbox behavior
MODIFY
WalletWasabi.Fluent/AddWallet/CreateWallet/ConfirmRecoveryWordsView.axaml
WalletWasabi.Fluent/AddWallet/CreateWallet/ConfirmRecoveryWordsView.axaml
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:i="clr-namespace:Avalonia.Xaml.Interactivity;assembly=Avalonia.Xaml.Interactivity"
+ xmlns:behaviors="clr-namespace:WalletWasabi.Fluent.Behaviors;assembly=WalletWasabi.Fluent"
xmlns:c="clr-namespace:WalletWasabi.Fluent.Controls"
mc:Ignorable="d"
d:DesignWidth="600" d:DesignHeight="500"
<c:ContentArea Title="Confirm recovery words" Caption="Type the required recovery words"
Classes="dialog">
<ItemsControl Items="{Binding ConfirmationWords}">
+ <i:Interaction.Behaviors>
+ <behaviors:FocusFirstTextBoxInItemsControlBehavior />
+ </i:Interaction.Behaviors>
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel Margin="0 0 0 20">

ADD
WalletWasabi.Fluent/Behaviors/FocusFirstTextBoxInItemsControlBehavior.cs
+using Avalonia.Controls;
+using Avalonia.LogicalTree;
+using Avalonia.Xaml.Interactivity;
+using System;
+
+namespace WalletWasabi.Fluent.Behaviors
+{
+ internal class FocusFirstTextBoxInItemsControlBehavior : Behavior<ItemsControl>
+ {
+ protected override void OnAttached()
+ {
+ base.OnAttached();
+
+ if (AssociatedObject is { } ao)
+ {
+ ao.LayoutUpdated += OnLayoutUpdated;
+ }
+ }
+
+ protected override void OnDetaching()
+ {
+ base.OnDetaching();
+
+ if (AssociatedObject is { } ao)
+ {
+ ao.LayoutUpdated -= OnLayoutUpdated;
+ }
+ }
+
+ private void OnLayoutUpdated(object? sender, EventArgs e)
+ {
+ AssociatedObject.FindLogicalDescendantOfType<TextBox>().Focus();
+ }
+ }
+}
\ No newline at end of file

focus textbox behavior