3using System.Threading.Tasks;
4using System.Windows.Input;
19 private readonly
Command cancel;
27 int i, c = Providers.Length;
30 for (i = 0; i < c; i++)
34 this.dialog.DataContext =
this;
36 this.sell =
new Command(this.CanExecuteSell, this.ExecuteSell);
37 this.cancel =
new Command(this.ExecuteCancel);
45 get => this.selectedServiceProvider.Value;
48 this.selectedServiceProvider.Value = value;
49 this.sell.RaiseCanExecuteChanged();
63 get => this.amount.Value;
66 this.amount.Value = value;
67 this.sell.RaiseCanExecuteChanged();
76 get => this.currency.Value;
79 this.currency.Value = value;
80 this.sell.RaiseCanExecuteChanged();
87 public ICommand
Sell => this.sell;
92 public ICommand
Cancel => this.cancel;
94 private bool CanExecuteSell()
97 this.SelectedServiceProvider is not
null &&
99 this.Currency.Length == 3 &&
103 private Task ExecuteSell()
105 this.dialog.DialogResult =
true;
106 return Task.CompletedTask;
109 private Task ExecuteCancel()
111 this.dialog.DialogResult =
false;
112 return Task.CompletedTask;
View mode for service providers.
Interaction logic for SellEDalerDialog.xaml
View model for the sell eDaler® dialog.
ICommand Cancel
Cancel Command
ServiceProviderModel[] ServiceProviders
Service Providers
ServiceProviderModel SelectedServiceProvider
Service Provider selected
ICommand Sell
Sell Command
Defines a custom command.
Abstract base class for view models
Generic class for properties
Interface for information about a service provider.