mirror of
https://github.com/PrismLibrary/Prism.git
synced 2026-10-20 15:42:19 +08:00
aac688c354
Migrates the Uno Platform E2E sample application from a multi-project structure to the recommended single-project architecture. This update consolidates platform-specific heads into the main `HelloWorld` project and introduces a new `Playground.Module` to showcase Prism for Uno.WinUI features like regions, dialogs, and modularity within the streamlined project setup. It also updates the target framework to .NET 10.
35 lines
929 B
C#
35 lines
929 B
C#
namespace Playground.Module.Dialogs;
|
|
|
|
internal class ConfirmDialogViewModel : BindableBase, IDialogAware
|
|
{
|
|
public ConfirmDialogViewModel()
|
|
{
|
|
AcceptCommand = new DelegateCommand(() => RequestClose.Invoke(new DialogResult(ButtonResult.OK)));
|
|
CancelCommand = new DelegateCommand(() => RequestClose.Invoke(new DialogResult(ButtonResult.Cancel)));
|
|
}
|
|
|
|
private string _message = string.Empty;
|
|
public string Message
|
|
{
|
|
get => _message;
|
|
set => SetProperty(ref _message, value);
|
|
}
|
|
|
|
public DelegateCommand AcceptCommand { get; }
|
|
|
|
public DelegateCommand CancelCommand { get; }
|
|
|
|
public DialogCloseListener RequestClose { get; set; }
|
|
|
|
public bool CanCloseDialog() => true;
|
|
|
|
public void OnDialogClosed()
|
|
{
|
|
}
|
|
|
|
public void OnDialogOpened(IDialogParameters parameters)
|
|
{
|
|
Message = parameters.GetValue<string>("message") ?? "Continue?";
|
|
}
|
|
}
|