Set the focus of passwordbox after app start.
MODIFY
WalletWasabi.Gui/Controls/LockScreen/PinLockScreen.xaml.cs
WalletWasabi.Gui/Controls/LockScreen/PinLockScreen.xaml.cs
@@ -5,6 +5,7 @@ using Avalonia.Input;
using ReactiveUI;
using System.Reactive.Linq;
using System;
+using Avalonia.LogicalTree;
namespace WalletWasabi.Gui.Controls.LockScreen
{
@@ -31,9 +32,27 @@ namespace WalletWasabi.Gui.Controls.LockScreen
this.WhenAnyValue(x => x.IsLocked)
.Where(x => x)
+ .ObserveOn(RxApp.MainThreadScheduler)
.Subscribe(x => inputField.Focus());
}
+ protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e)
+ {
+ base.OnAttachedToVisualTree(e);
+
+ // When the control first created on AppStart set the Focus of the password box.
+ // If you just simply set the Focus without delay it won't work.
+ Observable
+ .Interval(TimeSpan.FromSeconds(1))
+ .Take(1)
+ .ObserveOn(RxApp.MainThreadScheduler)
+ .Subscribe(x =>
+ {
+ var inputField = this.FindControl<NoparaPasswordBox>("InputField");
+ inputField.Focus();
+ });
+ }
+
private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);

Set the focus of passwordbox after app start.