Add ShowDialog mechanism.
MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/PinPadViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/PinPadViewModel.cs
@@ -36,7 +36,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
{
SendPinCommand = ReactiveCommand.Create(() =>
{
- OnClose();
+ Close();
},
this.WhenAny(x => x.MaskedPin, (maskedPin) => (!string.IsNullOrWhiteSpace(maskedPin.Value))));

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/WalletActionViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/WalletActionViewModel.cs
@@ -14,6 +14,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
{
private string _warningMessage;
private string _successMessage;
+ private object _dialogResult;
public WalletViewModel Wallet { get; }
public WalletService WalletService => Wallet.WalletService;
@@ -35,6 +36,30 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
IoC.Get<IShell>().AddOrSelectDocument(this);
}
+ public void Select()
+ {
+ IoC.Get<IShell>().Select(this);
+ }
+
+ public void Close()
+ {
+ OnClose();
+ }
+
+ public async Task<object> ShowDialogAsync()
+ {
+ DialogResult = null;
+ DisplayActionTab();
+
+ while (!IsClosed)
+ {
+ if (!IsSelected) // Prevent de-selection of tab.
+ Select();
+ await Task.Delay(100);
+ }
+ return DialogResult;
+ }
+
protected void SetWarningMessage(string message)
{
SuccessMessage = "";
@@ -86,5 +111,11 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
get => _successMessage;
set => this.RaiseAndSetIfChanged(ref _successMessage, value);
}
+
+ public object DialogResult
+ {
+ get => _dialogResult;
+ set => this.RaiseAndSetIfChanged(ref _dialogResult, value);
+ }
}
}

Add ShowDialog mechanism.