2using System.Threading.Tasks;
3using System.Windows.Input;
18 private readonly
Command cancel;
26 int i, c = Providers.Length;
29 for (i = 0; i < c; i++)
33 this.dialog.DataContext =
this;
35 this.buy =
new Command(this.CanExecuteBuy, this.ExecuteBuy);
36 this.cancel =
new Command(this.ExecuteCancel);
44 get => this.selectedServiceProvider.Value;
47 this.selectedServiceProvider.Value = value;
48 this.buy.RaiseCanExecuteChanged();
62 get => this.amount.Value;
65 this.amount.Value = value;
66 this.buy.RaiseCanExecuteChanged();
75 get => this.currency.Value;
78 this.currency.Value = value;
79 this.buy.RaiseCanExecuteChanged();
86 public ICommand
Buy => this.buy;
91 public ICommand
Cancel => this.cancel;
93 private bool CanExecuteBuy()
96 !(this.SelectedServiceProvider is
null) &&
99 this.Currency.ToUpper() == this.
Currency;
102 private Task ExecuteBuy()
104 this.dialog.DialogResult =
true;
105 return Task.CompletedTask;
108 private Task ExecuteCancel()
110 this.dialog.DialogResult =
false;
111 return Task.CompletedTask;
Interaction logic for BuyEDalerDialog.xaml
View model for the buy eDaler® dialog.
ServiceProviderModel SelectedServiceProvider
Service Provider selected
ServiceProviderModel[] ServiceProviders
Service Providers
ICommand Cancel
Cancel Command
View mode for service providers.
Defines a custom command.
Abstract base class for view models
Generic class for properties
Interface for information about a service provider.