Add Icon for dialogwindow

Add ShowInTaskBar for DialogOptions
This commit is contained in:
芬里尔吉崽
2024-06-17 14:01:01 +08:00
parent 8ae57f4a5b
commit 5eff797d5c
4 changed files with 50 additions and 6 deletions

View File

@@ -34,6 +34,12 @@
IsVisible="{Binding !#overlay.IsChecked}"
OffContent="Regular"
OnContent="Modal" />
<ToggleSwitch
Content="HideInTaskBar/ShowInTaskBar"
IsChecked="{Binding ShowInTaskBar}"
IsVisible="{Binding #overlay.IsChecked}"
OffContent="HideInTaskBar"
OnContent="ShowInTaskBar" />
<ToggleSwitch
Content="ClickOnMaskToClose"
IsChecked="{Binding CanLightDismiss}"
@@ -77,6 +83,12 @@
IsVisible="{Binding !#overlay2.IsChecked}"
OffContent="Local"
OnContent="Global" />
<ToggleSwitch
Content="HideInTaskBar/ShowInTaskBar"
IsChecked="{Binding ShowInTaskBar}"
IsVisible="{Binding #overlay2.IsChecked}"
OffContent="HideInTaskBar"
OnContent="ShowInTaskBar" />
<ToggleSwitch
Name="modal"
Content="Modal/Regular"

View File

@@ -26,6 +26,7 @@ public partial class DialogDemoViewModel: ObservableObject
[ObservableProperty] private bool _result;
[ObservableProperty] private DateTime? _date;
[ObservableProperty] private bool _fullScreen;
[ObservableProperty] private bool _showInTaskBar;
public DialogDemoViewModel()
{
@@ -33,6 +34,7 @@ public partial class DialogDemoViewModel: ObservableObject
ShowCustomDialogCommand = new AsyncRelayCommand(ShowCustomDialog);
IsModal = true;
IsGlobal = true;
ShowInTaskBar = false;
}
private async Task ShowDialog()
@@ -45,7 +47,8 @@ public partial class DialogDemoViewModel: ObservableObject
{
Title = "Please select a date",
Mode = SelectedMode,
Button = SelectedButton
Button = SelectedButton,
ShowInTaskBar = ShowInTaskBar,
});
Date = vm.Date;
}
@@ -97,13 +100,21 @@ public partial class DialogDemoViewModel: ObservableObject
if (IsModal)
{
Result = await Dialog.ShowCustomModal<DialogWithAction, DialogWithActionViewModel, bool>(
vm);
vm,
options: new DialogOptions
{
ShowInTaskBar = ShowInTaskBar
});
Date = vm.Date;
}
else
{
Dialog.ShowCustom<DialogWithAction, DialogWithActionViewModel>(
vm);
vm,
options: new DialogOptions
{
ShowInTaskBar = ShowInTaskBar
});
}
}
else