feat: implement multi layer dialog.

This commit is contained in:
rabbitism
2024-01-23 22:48:30 +08:00
parent 61ebba897b
commit c8540feeb3
15 changed files with 231 additions and 104 deletions

View File

@@ -1,4 +1,5 @@
using System;
using System.Threading.Tasks;
using System.Windows.Input;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
@@ -16,10 +17,13 @@ public partial class DialogWithActionViewModel: ObservableObject, IDialogContext
public ICommand OKCommand { get; set; }
public ICommand CancelCommand { get; set; }
public ICommand DialogCommand { get; set; }
public DialogWithActionViewModel()
{
OKCommand = new RelayCommand(OK);
CancelCommand = new RelayCommand(Cancel);
DialogCommand = new AsyncRelayCommand(ShowDialog);
Title = "Please select a date";
Date = DateTime.Now;
}
@@ -33,4 +37,9 @@ public partial class DialogWithActionViewModel: ObservableObject, IDialogContext
{
Closed?.Invoke(this, false);
}
private async Task ShowDialog()
{
await DialogBox.ShowOverlayModalAsync<DialogWithAction, DialogWithActionViewModel, bool>(new DialogWithActionViewModel(), "GlobalHost");
}
}