2using System.Threading.Tasks;
3using CommunityToolkit.Mvvm.ComponentModel;
4using CommunityToolkit.Mvvm.Input;
14using System.Globalization;
24 private bool isContact;
26 public decimal Change => this.TransactionEevent.Change < 0 ? -this.TransactionEevent.Change : this.TransactionEevent.Change;
28 public bool IsSender => this.TransactionEevent.Change < 0;
30 public bool HasMessage => this.TransactionEevent.HasMessage;
32 public bool MessageIsUrl => this.HasMessage && Uri.IsWellFormedUriString(this.TransactionEevent.Message, UriKind.Absolute);
34 public override async Task OnInitializeAsync()
36 await base.OnInitializeAsync();
38 await this.EvaluateIsContact();
40 this.OnPropertyChanged(nameof(this.IsContact));
43 public string? Message
48 return this.TransactionEevent.Message;
54 public string DestinationString
68 private async Task Close()
74 private async Task OpenChat()
78 string Remote = this.TransactionEevent.Remote;
79 if (
string.IsNullOrEmpty(Remote))
82 string? BareJid =
null;
83 string? LegalId =
null;
84 int AtIndex = Remote.IndexOf(
'@');
88 string AccountPart = Remote.Substring(0, AtIndex);
89 if (Guid.TryParse(AccountPart, out Guid
_))
90 LegalId = AccountPart;
93 ChatNavigationArgs Args =
new(LegalId, BareJid ?? Remote, this.TransactionEevent.FriendlyName);
107 private async Task ViewId()
111 string Remote = this.TransactionEevent.Remote;
112 if (
string.IsNullOrEmpty(Remote))
122 if (Identity is not
null)
124 ViewIdentityNavigationArgs ViewIdentityArgs =
new(Identity);
130 string LegalId = Contact.
LegalId;
131 if (!
string.IsNullOrEmpty(LegalId))
144 protected override Task OnPopAsync()
146 return base.OnPopAsync();
150 private async Task OpenMessageUri()
152 if (this.MessageIsUrl && this.Message is not
null)
156 await
App.OpenUrlAsync(this.Message);
167 private async Task EvaluateIsContact()
169 string Remote = this.TransactionEevent.Remote;
170 if (
string.IsNullOrEmpty(Remote))
172 this.IsContact =
false;
179 this.IsContact =
true;
186 if (Contact2 is not
null)
188 this.IsContact =
true;
193 if (Contact is not
null)
195 this.IsContact =
true;
200 if (Item is not
null)
202 this.IsContact =
true;
Represents an instance of the Neuro-Access app.
A strongly-typed resource class, for looking up localized strings, etc.
static string From
Looks up a localized string similar to From.
static string ScannedQrCode
Looks up a localized string similar to Scanned QR Code.
static string To
Looks up a localized string similar to To.
Base class that references services in the app.
static ILogService LogService
Log service.
static INavigationService NavigationService
The navigation service for navigating between pages.
static IPopupService PopupService
Popup service for presenting application popups.
static ITagProfile TagProfile
TAG Profile service.
static IContractOrchestratorService ContractOrchestratorService
Contract orchestrator service.
static IReportingStringLocalizer Localizer
Localization service
static IXmppService XmppService
The XMPP service for XMPP communication.
Holds navigation parameters specific to views displaying a list of contacts.
A page that displays a list of the current user's contacts.
A page to display when the user wants to view an identity.
Maintains information about an item in the roster.
partial class TransactionEventItem(AccountEventModel accountEvent, string friendlyName, string currency, string? transactionType)
Presentation model for a transaction event in history (no notification support).