1using CommunityToolkit.Mvvm.ComponentModel;
2using CommunityToolkit.Mvvm.Input;
20 private readonly
Token token;
21 private readonly TaskCompletionSource<TokenItem?>? selected;
45 this.selected = Selected;
48 if (this.
Glyph is not
null && this.
GlyphContentType.StartsWith(
"image/", StringComparison.OrdinalIgnoreCase))
50 this.GlyphImage = ImageSource.FromStream(() =>
new MemoryStream(this.
Glyph));
51 this.HasGlyphImage =
true;
53 double s = 32.0 / this.token.GlyphWidth;
54 double s2 = 32.0 / this.token.GlyphHeight;
61 this.GlyphWidth = (int)(this.token.GlyphWidth * s + 0.5);
62 this.GlyphHeight = (int)(this.token.GlyphHeight * s + 0.5);
66 this.GlyphImage =
null;
67 this.HasGlyphImage =
false;
84 public DateTime
Created => this.token.Created;
89 public DateTime
Updated => this.token.Updated;
94 public DateTime
Expires => this.token.Expires;
164 public byte[]
Glyph => this.token.Glyph;
179 public decimal
Value => this.token.Value;
184 public string[]
Witness => this.token.Witness;
229 public string Owner => this.token.Owner;
305 private ImageSource? glyphImage;
311 private bool hasGlyphImage;
317 private int glyphWidth;
323 private int glyphHeight;
339 return this.nrEvents;
352 return this.@
new ??
false;
356 private void CheckEvents()
358 if (!this.@
new.HasValue)
360 this.nrEvents = this.notificationEvents.Length;
361 this.@
new = this.nrEvents > 0;
367 this.notificationEvents = [];
378 private async Task Clicked()
380 if (this.selected is
null)
388 this.selected.TrySetResult(
this);
Base class that references services in the app.
static IUiService UiService
Service serializing and managing UI-related tasks.
static INotificationService NotificationService
Service for managing notifications for the user.
Encapsulates a Token object.
string UniqueName
Unique name used to compare items.
bool New
If the event item is new or not.
string Currency
Currency of Value.
HashFunction DefinitionSchemaHashFunction
Hash function used to compute DefinitionSchemaDigest.
Duration? ArchiveRequired
Required archiving time after token expires.
string DefinitionNamespace
XML Namespace used in the Definition
string OwnerJid
JID of owner
string[] Assessor
Assessors
string CreatorJid
JID of Creator.
string CreationContract
Contract used to create the contract.
int Ordinal
Ordinal of token, within batch.
string Owner
Current owner
bool OwnerCanDestroyBatch
If the owner can destroy the entire batch of tokens, if owner of every token in the batch.
string Description
Description engraved into the token.
string TrustProviderJid
JID of TrustProvider
TokenTag[] Tags
Any custom Token Tags provided during creation of the token.
string TrustProvider
Trust Provider asserting the validity of the token
string GlyphContentType
Content-Type of glyph
byte[] Glyph
Glyph of token.
string[] Witness
Witnesses
string[] Certifier
Certifiers
int BatchSize
Number of tokens in batch being created.
string FriendlyName
Friendly name of token.
DateTime SignatureTimestamp
Signature timestamp
string ShortTokenId
ShortToken ID
NotificationEvent[] NotificationEvents
Associated notification events
decimal Value
(Last) Value of token
byte[] DefinitionSchemaDigest
Digest of schema used to validate token definition XML.
Duration? ArchiveOptional
Optional archiving time after required archiving time.
DateTime Created
When token was created.
string Reference
Any reference provided by the token creator.
int NrEvents
Number of notification events recorded for the item.
bool OwnerCanDestroyIndividual
If the owner can destroy an individual token.
bool HasStateMachine
If the token is associated with a state-machine.
string[] Valuator
Valuators
bool CreatorCanDestroy
If the creator can destroy the token.
ContractVisibility Visibility
Visibility of token
bool CertifierCanDestroy
If a certifier can destroy the token.
string OwnershipContract
Contract used to define the current ownership
string Category
Category of token.
string Creator
Creator of token
TokenItem(Token Token, NotificationEvent[] NotificationEvents)
Encapsulates a Token object.
DateTime Expires
When token expires.
DateTime Updated
When token was last updated.
string Definition
XML Definition of token.
string[] CertifierJids
JIDs of certifiers
TokenItem(Token Token, TaskCompletionSource< TokenItem?>? Selected, NotificationEvent[] NotificationEvents)
Encapsulates a Token object.
Holds navigation parameters specific to a token.
A page that allows the user to view information about a token.
Abstract base class of signatures
Task DeleteEvents(NotificationEventType Type, CaseInsensitiveString Category)
Deletes events for a given button and category.
Task GoToAsync(string Route, BackMethod BackMethod=BackMethod.Inherited, string? UniqueId=null)
Navigates the AppShell to the specified route, with page arguments to match.
Task GoBackAsync(bool Animate=true)
Returns to the previous page/route.
abstract class NotificationEvent()
Abstract base class of notification events.
BackMethod
Navigation Back Method
TokenIdMethod
By which mechanism the Token ID was created
ContractVisibility
Visibility types for contracts.
HashFunction
Hash method enumeration.
Represents a duration value, as defined by the xsd:duration data type: http://www....