simplify infra
MODIFY
WalletWasabi.Fluent/ViewModels/MainViewModel.cs
WalletWasabi.Fluent/ViewModels/MainViewModel.cs
@@ -8,11 +8,29 @@ using WalletWasabi.Fluent.ViewModels.Dialog;
namespace WalletWasabi.Fluent.ViewModels
{
- public class MainViewModel : ModalDialogHostViewModelBase
+ public class MainViewModel : ViewModelBase
{
+ private DialogViewModelBase _currentDialog;
+
+ public DialogViewModelBase CurrentDialog
+ {
+ get => _currentDialog;
+ private set => this.RaiseAndSetIfChanged(ref _currentDialog, value, nameof(CurrentDialog));
+ }
+
public MainViewModel()
{
- base.SetHost(this);
+
+ }
+
+ public void ShowDialog<TDialog>(TDialog dialogViewModel) where TDialog : DialogViewModelBase
+ {
+ CurrentDialog = dialogViewModel;
+ }
+
+ public void CloseDialog()
+ {
+ CurrentDialog = null;
}
}
}
\ No newline at end of file

simplify infra