Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
EDalerReceivedViewModel.cs
1using System.ComponentModel;
2using System.Text;
3using CommunityToolkit.Mvvm.ComponentModel;
4using CommunityToolkit.Mvvm.Input;
6
8{
13 {
19 : base()
20 {
21 this.Amount = Args?.Balance?.Amount;
22 this.Currency = Args?.Balance?.Currency;
23 this.Timestamp = Args?.Balance?.Timestamp;
24
25 if (Args?.Balance?.Event is null)
26 {
27 this.HasId = false;
28 this.HasFrom = false;
29 this.HasMessage = false;
30 this.HasChange = false;
31 }
32 else
33 {
34 this.Id = Args.Balance?.Event?.TransactionId;
35 this.From = Args.Balance?.Event?.Remote;
36 this.Message = Args.Balance?.Event?.Message;
37 this.Change = Args.Balance?.Event?.Change;
38
39 this.HasId = true;
40 this.HasFrom = true;
41 this.HasMessage = true;
42 this.HasChange = true;
43 }
44
45 StringBuilder Url = new();
46
47 Url.Append("https://");
48 Url.Append(ServiceRef.TagProfile.Domain);
49 Url.Append("/Images/eDalerFront200.png");
50
51 this.EDalerFrontGlyph = Url.ToString();
52
53 Url.Clear();
54 Url.Append("https://");
55 Url.Append(ServiceRef.TagProfile.Domain);
56 Url.Append("/Images/eDalerBack200.png");
57
58 this.EDalerBackGlyph = Url.ToString();
59 }
60
61 #region Properties
62
66 [ObservableProperty]
67 private decimal? amount;
68
72 [ObservableProperty]
73 private decimal? change;
74
78 [ObservableProperty]
79 private bool hasChange;
80
84 [ObservableProperty]
85 private string? currency;
86
90 [ObservableProperty]
91 private DateTime? timestamp;
92
96 [ObservableProperty]
97 private Guid? id;
98
102 [ObservableProperty]
103 private bool hasId;
104
108 [ObservableProperty]
109 private string? from;
110
114 [ObservableProperty]
115 private bool hasFrom;
116
120 [ObservableProperty]
121 private string? message;
122
126 [ObservableProperty]
127 private bool hasMessage;
128
132 [ObservableProperty]
133 private string? eDalerFrontGlyph;
134
138 [ObservableProperty]
139 private string? eDalerBackGlyph;
140
141 #endregion
142
144 protected override void OnPropertyChanged(PropertyChangedEventArgs e)
145 {
146 base.OnPropertyChanged(e);
147
148 switch (e.PropertyName)
149 {
150 case nameof(this.IsConnected):
151 this.AcceptCommand.NotifyCanExecuteChanged();
152 break;
153 }
154 }
155
159 [RelayCommand(CanExecute = nameof(IsConnected))]
160 private Task Accept()
161 {
162 return this.GoBack();
163 }
164 }
165}
Base class that references services in the app.
Definition: ServiceRef.cs:31
static ITagProfile TagProfile
TAG Profile service.
Definition: ServiceRef.cs:79
virtual async Task GoBack()
Method called when user wants to navigate to the previous screen.
Holds navigation parameters specific to an eDaler balance event.
The view model to bind to for displaying information about an incoming balance change.
EDalerReceivedViewModel(EDalerBalanceNavigationArgs? Args)
Creates an instance of the EDalerReceivedViewModel class.
A view model that holds the XMPP state.