1using CommunityToolkit.Mvvm.ComponentModel;
2using CommunityToolkit.Mvvm.Input;
9using System.ComponentModel;
10using System.Globalization;
33 this.Currency = Args?.
Balance?.Currency;
36 this.AmountText =
string.Empty;
37 this.AmountOk =
false;
40 this.AmountExtraText =
string.Empty;
41 this.AmountExtraOk =
false;
52 private decimal amount;
58 private bool amountOk;
64 private string? amountText;
66 protected override void OnPropertyChanged(PropertyChangedEventArgs e)
68 base.OnPropertyChanged(e);
70 switch (e.PropertyName)
72 case nameof(this.AmountText):
73 if (
CommonTypes.TryParse(this.AmountText, out decimal d) && d > 0)
79 this.AmountOk =
false;
82 case nameof(this.AmountExtraText):
83 if (string.IsNullOrEmpty(this.AmountExtraText))
85 this.AmountExtra =
null;
86 this.AmountExtraOk =
true;
91 this.AmountExtraOk =
true;
94 this.AmountExtraOk =
false;
103 private decimal? amountExtra;
109 private bool amountExtraOk;
115 private string? amountExtraText;
121 private string? currency;
127 private string? message;
133 private bool encryptMessage;
143 private Task GenerateQrCode()
150 this.Currency ??
string.Empty,
this.Message ??
string.Empty);
155 this.Currency ??
string.Empty,
this.Message ??
string.Empty);
158 MainThread.BeginInvokeOnMainThread(async () =>
160 this.GenerateQrCode(Uri);
162 await this.page.ShowQrCode();
164 this.HasQrCode =
true;
167 return Task.CompletedTask;
174 private async Task ShareContact()
178 TaskCompletionSource<ContactInfoModel?> Selected =
new();
190 if (
string.IsNullOrEmpty(Contact.
BareJid))
197 StringBuilder Markdown =
new();
199 Markdown.Append(
";
202 Markdown.Append(this.QrCodeUri);
203 Markdown.Append(
')');
207 if (Contact.
Contact is not
null)
209 await Task.Delay(100);
226 private async Task ShareExternal()
228 if (this.QrCodeBin is
null)
233 string? Message = this.Message;
234 if (
string.IsNullOrEmpty(Message))
264 case "AmountExtraText":
277 #region ILinkableView
A strongly-typed resource class, for looking up localized strings, etc.
static string Share
Looks up a localized string similar to Share.
static string NetworkAddressOfContactUnknown
Looks up a localized string similar to Network address of contact unknown..
static string RequestPayment
Looks up a localized string similar to Request Payment.
static string SelectFromWhomToRequestPayment
Looks up a localized string similar to Select from whom to request payment..
static string RequestPaymentMessage
Looks up a localized string similar to Requesting payment of {0} {1}..
static string ErrorTitle
Looks up a localized string similar to An error has occurred.
Base class that references services in the app.
static ILogService LogService
Log service.
static IUiService UiService
Service serializing and managing UI-related tasks.
static INavigationService NavigationService
The navigation service for navigating between pages.
static ITagProfile TagProfile
TAG Profile service.
static IReportingStringLocalizer Localizer
Localization service
static IXmppService XmppService
The XMPP service for XMPP communication.
static IPlatformSpecific PlatformSpecific
Localization service
Holds navigation parameters specific to views displaying a list of contacts.
A page that displays a list of the current user's contacts.
The view model to bind to when displaying the list of contacts.
Contact Information model, including related notification information.
ContactInfo? Contact
Contact Information object in database.
CaseInsensitiveString? BareJid
Bare JID of contact.
Holds navigation parameters specific to views displaying a list of contacts.
A page that displays a list of the current user's contacts.
Holds navigation parameters for the calculator.
A page that allows the user to calculate the value of a numerical input field.
A view model that holds the XMPP state.
void RemoveQrCode()
Removes the QR-code
Holds navigation parameters specific to an eDaler balance event.
Balance? Balance
eDaler balance object.
A page that displays information about eDaler received.
The view model to bind to for requesting a payment.
async Task OpenCalculator(object Parameter)
Opens the calculator for calculating the value of a numerical property.
override Task< string > Title
Title of the current view
RequestPaymentViewModel(RequestPaymentPage Page, EDalerBalanceNavigationArgs? Args)
The view model to bind to for requesting a payment.
Helps with parsing of commong data types.
static bool TryParse(string s, out double Value)
Tries to decode a string encoded double.
Task GoToAsync(string Route)
Navigates to the specified route and pushes the page onto the navigation stack.
Task DisplayException(Exception Exception, string? Title=null)
Displays an alert/message box to the user.
Task< bool > DisplayAlert(string Title, string Message, string? Accept=null, string? Cancel=null)
Displays an alert/message box to the user.
BackMethod
Navigation Back Method
delegate string ToString(IElement Element)
Delegate for callback methods that convert an element value to a string.