Observe on main thread.
MODIFY
WalletWasabi.Gui/Controls/LockScreen/LockScreenBase.cs
WalletWasabi.Gui/Controls/LockScreen/LockScreenBase.cs
using System;
+using System.Reactive.Linq;
using Avalonia;
using Avalonia.Controls;
using ReactiveUI;
@@ -7,16 +8,23 @@ namespace WalletWasabi.Gui.Controls.LockScreen
{
public abstract class LockScreenBase : UserControl
{
- private bool _isLocked, _currentState;
+ private bool _currentState;
+ private bool _isLocked;
public static readonly DirectProperty<LockScreenBase, bool> IsLockedProperty =
AvaloniaProperty.RegisterDirect<LockScreenBase, bool>(nameof(IsLocked),
o => o.IsLocked,
(o, v) => o.IsLocked = v);
+ public bool IsLocked
+ {
+ get => _isLocked;
+ set => SetAndRaise(IsLockedProperty, ref _isLocked, value);
+ }
public LockScreenBase()
{
this.WhenAnyValue(x => x.IsLocked)
+ .ObserveOn(RxApp.MainThreadScheduler)
.Subscribe(IsLockedChanged);
}
@@ -38,12 +46,6 @@ namespace WalletWasabi.Gui.Controls.LockScreen
}
}
- public bool IsLocked
- {
- get => _isLocked;
- set => SetAndRaise(IsLockedProperty, ref _isLocked, value);
- }
-
public abstract void DoLock();
public abstract void DoUnlock();
}

MODIFY
WalletWasabi.Gui/Controls/LockScreen/PINLock.xaml.cs
WalletWasabi.Gui/Controls/LockScreen/PINLock.xaml.cs
@@ -30,11 +30,11 @@ namespace WalletWasabi.Gui.Controls.LockScreen
this.PinLockPwdBox = this.FindControl<NoparaPasswordBox>("PinLockPwdBox");
PinLockPwdBox.WhenAnyValue(x => x.Password)
+ .ObserveOn(RxApp.MainThreadScheduler)
.Select(Guard.Correct)
.Where(x => x != string.Empty)
.DistinctUntilChanged()
.Throttle(TimeSpan.FromSeconds(1d))
- .ObserveOn(RxApp.MainThreadScheduler)
.Subscribe(CheckPIN);
}

Observe on main thread.