2using CommunityToolkit.Mvvm.ComponentModel;
3using CommunityToolkit.Mvvm.Input;
23 private readonly
Token token;
24 private readonly TaskCompletionSource<TokenItem?>? selected;
48 this.selected = Selected;
51 if (this.
Glyph is not
null && this.
GlyphContentType.StartsWith(
"image/", StringComparison.OrdinalIgnoreCase))
53 this.GlyphImage = ImageSource.FromStream(() =>
new MemoryStream(this.
Glyph));
54 this.HasGlyphImage =
true;
56 double s = 32.0 / this.token.GlyphWidth;
57 double s2 = 32.0 / this.token.GlyphHeight;
64 this.GlyphWidth = (int)(this.token.GlyphWidth * s + 0.5);
65 this.GlyphHeight = (int)(this.token.GlyphHeight * s + 0.5);
69 this.GlyphImage =
null;
70 this.HasGlyphImage =
false;
87 public DateTime
Created => this.token.Created;
92 public DateTime
Updated => this.token.Updated;
97 public DateTime
Expires => this.token.Expires;
167 public byte[]
Glyph => this.token.Glyph;
182 public decimal
Value => this.token.Value;
187 public string[]
Witness => this.token.Witness;
232 public string Owner => this.token.Owner;
318 private ImageSource? glyphImage;
324 private bool hasGlyphImage;
330 private int glyphWidth;
336 private int glyphHeight;
352 return this.nrEvents;
365 return this.@
new ??
false;
369 private void CheckEvents()
371 if (!this.@
new.HasValue)
373 this.nrEvents = this.notificationEvents.Length;
374 this.@
new = this.nrEvents > 0;
380 this.notificationEvents = [];
387 public async Task<ImageSource?> RenderEmbeddedLayout()
394 return ImageSource.FromStream(() =>
396 SKData Data = Img.Encode(SKEncodedImageFormat.Png, 100);
397 return Data.AsStream();
405 private async Task Clicked()
407 if (this.selected is
null)
415 this.selected.TrySetResult(
this);
Base class that references services in the app.
static IUiService UiService
Service serializing and managing UI-related tasks.
static INavigationService NavigationService
The navigation service for navigating between pages.
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
bool HasEmbeddedLayout
If the token have an embedded layout.
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.
XmlElement EmbeddedLayoutDefinition
The embedded layout of the token.
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.
Task< SKImage > RenderEmbeddedLayout()
Renders the embedded layout.
bool HasEmbeddedLayout
If the token has embedded layout information.
Abstract base class of signatures
Task DeleteEvents(NotificationEventType Type, CaseInsensitiveString Category)
Deletes events for a given button and category.
Task GoToAsync(string Route)
Navigates to the specified route and pushes the page onto the navigation stack.
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....