Remove the canClose property
MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/CoinJoinTabViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/CoinJoinTabViewModel.cs
@@ -390,7 +390,6 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
}
AmountQueued = chaumianClient.State.SumAllQueuedCoinAmounts();
- MainWindowViewModel.Instance.CanClose = AmountQueued == Money.Zero;
var registrableRound = chaumianClient.State.GetRegistrableRoundOrDefault();
if (registrableRound is { })

MODIFY
WalletWasabi.Gui/MainWindow.xaml.cs
WalletWasabi.Gui/MainWindow.xaml.cs
@@ -86,7 +86,7 @@ namespace WalletWasabi.Gui
// Indicate -> do not add any more alices to the coinjoin.
Global.WalletManager.SignalQuitPending(true);
- if (!MainWindowViewModel.Instance.CanClose)
+ if (Global.WalletManager.AnyCoinJoinInProgress())
{
var dialog = new CannotCloseDialogViewModel();

MODIFY
WalletWasabi.Gui/ViewModels/MainWindowViewModel.cs
WalletWasabi.Gui/ViewModels/MainWindowViewModel.cs
@@ -19,7 +19,6 @@ namespace WalletWasabi.Gui.ViewModels
public class MainWindowViewModel : ViewModelBase, IDisposable
{
private ModalDialogViewModelBase _modalDialog;
- private bool _canClose = true;
private string _title = "Wasabi Wallet";
private WindowState _windowState;
private StatusBarViewModel _statusBar;
@@ -92,12 +91,6 @@ namespace WalletWasabi.Gui.ViewModels
private set => this.RaiseAndSetIfChanged(ref _modalDialog, value);
}
- public bool CanClose
- {
- get => _canClose;
- set => this.RaiseAndSetIfChanged(ref _canClose, value);
- }
-
public void PushLockScreen(LockScreenViewModelBase lockScreen)
{
if (LockScreen is { })

Remove the canClose property