2using System.Threading.Tasks;
3using System.Windows.Input;
19 private readonly
Command transfer;
20 private readonly
Command cancel;
32 this.dialog.DataContext =
this;
34 this.transfer =
new Command(this.CanExecuteTransfer, this.ExecuteTransfer);
35 this.cancel =
new Command(this.ExecuteCancel);
43 get => this.recipient.Value;
46 this.recipient.Value = value;
47 this.transfer.RaiseCanExecuteChanged();
56 get => this.amount.Value;
59 this.amount.Value = value;
60 this.transfer.RaiseCanExecuteChanged();
69 get => this.amountExtra.Value;
72 this.amountExtra.Value = value;
73 this.transfer.RaiseCanExecuteChanged();
82 get => this.currency.Value;
85 this.currency.Value = value;
86 this.transfer.RaiseCanExecuteChanged();
95 get => this.validNrDays.Value;
98 this.validNrDays.Value = value;
99 this.transfer.RaiseCanExecuteChanged();
108 get => this.message.Value;
111 this.message.Value = value;
112 this.transfer.RaiseCanExecuteChanged();
126 private bool CanExecuteTransfer()
131 this.AmountExtra >= 0 &&
132 this.ValidNrDays > 0 &&
133 this.Currency.Length == 3 &&
134 this.Currency == this.
Currency.ToUpper();
137 private Task ExecuteTransfer()
139 this.dialog.DialogResult =
true;
140 return Task.CompletedTask;
143 private Task ExecuteCancel()
145 this.dialog.DialogResult =
false;
146 return Task.CompletedTask;
Interaction logic for TransferEDalerDialog.xaml
View model for the Transfer eDaler® dialog.
int ValidNrDays
Valid number of days.
ICommand Cancel
Cancel Command
string Recipient
Recipient
decimal AmountExtra
Amount
ICommand Transfer
Transfer Command
Defines a custom command.
Abstract base class for view models
Generic class for properties