1using System.Globalization;
2using CommunityToolkit.Mvvm.ComponentModel;
3using CommunityToolkit.Mvvm.Input;
23 public partial class TransactionEventItem(AccountEventModel accountEvent, string friendlyName, string currency, string? transactionType)
25 private readonly AccountEventModel accountEvent = accountEvent;
26 private readonly
string friendlyName = friendlyName;
27 private readonly
string currency = currency;
28 private readonly
string? transactionType = transactionType;
31 public decimal Reserved => this.accountEvent.Reserved;
32 public decimal Change => this.accountEvent.Change;
33 public DateTime Timestamp => this.accountEvent.Timestamp;
34 public Guid TransactionId => this.accountEvent.TransactionId;
35 public string Remote => this.accountEvent.Remote;
36 public string FriendlyName => this.friendlyName;
37 public string Message => this.accountEvent.Message;
38 public bool HasMessage => !
string.IsNullOrEmpty(this.accountEvent.Message);
39 public string Currency => this.currency;
45 public Color ChangeColor => this.Change >= 0 ? AppColors.TnPSuccessContent :
AppColors.ContentPrimary;
47 public string TimestampStr
51 DateTime Dt = this.Timestamp.ToLocalTime();
52 DateTime Now = DateTime.Now;
53 TimeSpan Span = Now - Dt;
57 if (Span.TotalMinutes < 1)
59 else if (Span.TotalHours < 1)
61 else if (Span.TotalDays < 1)
64 TimeString = Dt.ToString(
"m", CultureInfo.CurrentCulture);
71 public bool IsReserved => this.accountEvent.Reserved != 0;
77 public async Task OpenDetailsAsync()
Contains information about a balance.
Balance(DateTime Timestamp, decimal Amount, decimal Reserved, CaseInsensitiveString Currency, AccountEvent Event)
Contains information about a balance.
A strongly-typed resource class, for looking up localized strings, etc.
static string Transfer
Looks up a localized string similar to Transfer.
static string MinutesAgoFormat
Looks up a localized string similar to {0} minutes ago.
static string HoursAgoFormat
Looks up a localized string similar to {0} hours ago.
static string Now
Looks up a localized string similar to Now.
Base class that references services in the app.
static IPopupService PopupService
Popup service for presenting application popups.
static IReportingStringLocalizer Localizer
Localization service
Static class that gives access to app-specific themed colors. All colors are fetched directly from th...
Converts values to strings.
static string ToString(decimal Money)
Converts a monetary value to a string, removing any round-off errors.
partial class TransactionEventItem(AccountEventModel accountEvent, string friendlyName, string currency, string? transactionType)
Presentation model for a transaction event in history (no notification support).