make lockscreen a stack, so multiple lockscreens can be active at once.
MODIFY
WalletWasabi.Gui/Controls/LockScreen/PinLockScreenViewModel.cs
WalletWasabi.Gui/Controls/LockScreen/PinLockScreenViewModel.cs
@@ -62,7 +62,7 @@ namespace WalletWasabi.Gui.Controls.LockScreen
if (global.UiConfig.LockScreenPinHash == HashHelpers.GenerateSha256Hash(x))
{
- IsLocked = false;
+ Close();
PinInput = string.Empty;
}
});

MODIFY
WalletWasabi.Gui/Controls/LockScreen/WasabiLockScreenViewModelBase.cs
WalletWasabi.Gui/Controls/LockScreen/WasabiLockScreenViewModelBase.cs
@@ -21,8 +21,6 @@ namespace WalletWasabi.Gui.Controls.LockScreen
.ObserveOn(RxApp.MainThreadScheduler)
.BindTo(global.UiConfig, y => y.LockScreenActive)
.DisposeWith(Disposables);
-
- IsLocked = global.UiConfig.LockScreenActive;
}
}
}

MODIFY
WalletWasabi.Gui/Tabs/LegalDocumentsViewModel.cs
WalletWasabi.Gui/Tabs/LegalDocumentsViewModel.cs
@@ -34,7 +34,7 @@ namespace WalletWasabi.Gui.Tabs
IsAgreed = true;
await LegalDoc.ToFileAsync(Content);
Locator.Current.GetService<Global>().LegalDocuments = LegalDoc;
- base.IsLocked = false;
+ Close();
});
AgreeClicked

MODIFY
WalletWasabi.Gui/ViewModels/MainWindowViewModel.cs
WalletWasabi.Gui/ViewModels/MainWindowViewModel.cs
@@ -6,6 +6,7 @@ using NBitcoin;
using ReactiveUI;
using Splat;
using System;
+using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reactive;
@@ -28,6 +29,7 @@ namespace WalletWasabi.Gui.ViewModels
private StatusBarViewModel _statusBar;
private LockScreenViewModelBase _lockScreen;
private volatile bool _disposedValue = false; // To detect redundant calls
+ private Stack<LockScreenViewModelBase> _lockScreens;
public MainWindowViewModel()
{
@@ -35,6 +37,8 @@ namespace WalletWasabi.Gui.ViewModels
var global = Locator.Current.GetService<Global>();
+ _lockScreens = new Stack<LockScreenViewModelBase>();
+
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
var uiConfig = global.UiConfig;
@@ -88,7 +92,35 @@ namespace WalletWasabi.Gui.ViewModels
public LockScreenViewModelBase LockScreen
{
get => _lockScreen;
- set => this.RaiseAndSetIfChanged(ref _lockScreen, value);
+ private set => this.RaiseAndSetIfChanged(ref _lockScreen, value);
+ }
+
+ public void PushLockScreen (LockScreenViewModelBase lockScreen)
+ {
+ if (LockScreen != null)
+ {
+ _lockScreens.Push(LockScreen);
+ }
+
+ lockScreen.Initialize();
+ LockScreen = lockScreen;
+ }
+
+ public void CloseLockScreen(LockScreenViewModelBase lockScreen)
+ {
+ if(lockScreen == LockScreen)
+ {
+ LockScreen?.Dispose();
+
+ if(_lockScreens.Count > 0)
+ {
+ LockScreen = _lockScreens.Pop();
+ }
+ else
+ {
+ LockScreen = null;
+ }
+ }
}
public IShell Shell { get; }
@@ -115,11 +147,9 @@ namespace WalletWasabi.Gui.ViewModels
.ObserveOn(RxApp.MainThreadScheduler)
.Subscribe(_ =>
{
- LockScreen?.Dispose();
-
- LockScreen = uiConfig.LockScreenPinHash.Length == 0
+ PushLockScreen(uiConfig.LockScreenPinHash.Length == 0
? (WasabiLockScreenViewModelBase)new SlideLockScreenViewModel()
- : new PinLockScreenViewModel();
+ : new PinLockScreenViewModel());
});
}

make lockscreen a stack, so multiple lockscreens can be active at once.