feat: refactor OverlayDialog and add options.

This commit is contained in:
rabbitism
2024-02-02 00:01:18 +08:00
parent fb11be0169
commit 8f4d88b87f
8 changed files with 280 additions and 58 deletions

View File

@@ -103,12 +103,15 @@ public class DialogDemoViewModel: ObservableObject
{
if (IsModal)
{
DefaultResult = await OverlayDialog.ShowModalAsync<PlainDialog, PlainDialogViewModel>(
DefaultResult = await OverlayDialog.ShowModal<PlainDialog, PlainDialogViewModel>(
vm,
IsGlobal ? null : "LocalHost",
"Please select a date",
SelectedMode,
SelectedButton
new OverlayDialogOptions()
{
Title = "Please select a date",
Mode = SelectedMode,
Buttons = SelectedButton
}
);
Date = vm.Date;
}
@@ -117,9 +120,12 @@ public class DialogDemoViewModel: ObservableObject
OverlayDialog.Show<PlainDialog, PlainDialogViewModel>(
new PlainDialogViewModel(),
IsGlobal ? null : "LocalHost",
"Please select a date",
SelectedMode,
SelectedButton);
new OverlayDialogOptions()
{
Title = "Please select a date",
Mode = SelectedMode,
Buttons = SelectedButton
});
}
}
@@ -148,7 +154,7 @@ public class DialogDemoViewModel: ObservableObject
{
if (IsModal)
{
Result = await OverlayDialog.ShowCustomModalAsync<DialogWithAction, DialogWithActionViewModel, bool>(
Result = await OverlayDialog.ShowCustomModal<DialogWithAction, DialogWithActionViewModel, bool>(
vm, IsGlobal ? null : "LocalHost");
Date = vm.Date;
}