2using System.Threading.Tasks;
3using System.Windows.Input;
14 private readonly
Command cancel;
19 this.dialog.DataContext =
this;
21 this.ok =
new Command(this.ExecuteOk);
22 this.cancel =
new Command(this.ExecuteCancel);
28 public string Title {
get;
set; }
33 public string Label {
get;
set; }
38 public string Text {
get;
set; }
53 public ICommand
Ok => this.ok;
58 public ICommand
Cancel => this.cancel;
60 private Task ExecuteOk()
62 this.dialog.DialogResult =
true;
63 return Task.CompletedTask;
66 private Task ExecuteCancel()
68 this.dialog.DialogResult =
false;
69 return Task.CompletedTask;
Interaction logic for PromptDialog.xaml
View model for the prompt dialog.
string Text
Text being edited
string CancelText
Text of the Cancel button
ICommand Cancel
Cancel Command
string Title
Title of window
string OkText
Text of the OK button
string Label
Text label presented to user
Defines a custom command.