Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
PromptModel.cs
2using System.Threading.Tasks;
3using System.Windows.Input;
4
6{
10 public class PromptModel
11 {
12 private readonly PromptDialog dialog;
13 private readonly Command ok;
14 private readonly Command cancel;
15
16 public PromptModel(PromptDialog Dialog)
17 {
18 this.dialog = Dialog;
19 this.dialog.DataContext = this;
20
21 this.ok = new Command(this.ExecuteOk);
22 this.cancel = new Command(this.ExecuteCancel);
23 }
24
28 public string Title { get; set; }
29
33 public string Label { get; set; }
34
38 public string Text { get; set; }
39
43 public string OkText { get; set; }
44
48 public string CancelText { get; set; }
49
53 public ICommand Ok => this.ok;
54
58 public ICommand Cancel => this.cancel;
59
60 private Task ExecuteOk()
61 {
62 this.dialog.DialogResult = true;
63 return Task.CompletedTask;
64 }
65
66 private Task ExecuteCancel()
67 {
68 this.dialog.DialogResult = false;
69 return Task.CompletedTask;
70 }
71 }
72}