1using CommunityToolkit.Mvvm.ComponentModel;
2using System.Globalization;
8using CommunityToolkit.Mvvm.Input;
36 await base.OnInitialize();
38 this.AssignProperties();
47 private DateTime? created;
53 private DateTime? updated;
59 private string? legalId;
71 private DateTime? from;
83 private string? firstName;
89 private string? middleNames;
95 private string? lastNames;
101 private string? personalNumber;
107 private string? address;
113 private string? address2;
119 private string? zipCode;
125 private string? area;
131 private string? city;
137 private string? region;
143 private string? countryCode;
149 private string? nationalityCode;
155 private string? gender;
161 private DateTime? birthDate;
167 private string? orgName;
173 private string? orgNumber;
179 private string? orgDepartment;
185 private string? orgRole;
191 private string? orgAddress;
197 private string? orgAddress2;
203 private string? orgZipCode;
209 private string? orgArea;
215 private string? orgCity;
221 private string? orgRegion;
227 private string? orgCountryCode;
233 private bool? hasOrg;
239 private bool? isApproved;
245 private string? role;
251 private string? timestamp;
257 private string? isTransferable;
263 private string? bareJid;
269 private string? phoneNr;
275 private string? eMail;
281 private string? signature;
285 private void AssignProperties()
287 if (this.identity is not
null)
289 this.Created = this.identity.Created;
290 this.Updated = this.identity.Updated.GetDateOrNullIfMinValue();
291 this.LegalId = this.identity.Id;
292 this.State = this.identity.State;
293 this.From = this.identity.From.GetDateOrNullIfMinValue();
294 this.To = this.identity.To.GetDateOrNullIfMinValue();
313 if (!
string.IsNullOrEmpty(BirthDayStr) &&
int.TryParse(BirthDayStr, out
int BirthDay) &&
314 !
string.IsNullOrEmpty(BirthMonthStr) &&
int.TryParse(BirthMonthStr, out
int BirthMonth) &&
315 !
string.IsNullOrEmpty(BirthYearStr) &&
int.TryParse(BirthYearStr, out
int BirthYear))
319 this.BirthDate =
new DateTime(BirthYear, BirthMonth, BirthDay);
324 this.BirthDate =
null;
340 !
string.IsNullOrEmpty(this.OrgName) ||
341 !
string.IsNullOrEmpty(this.OrgNumber) ||
342 !
string.IsNullOrEmpty(this.OrgDepartment) ||
343 !
string.IsNullOrEmpty(this.OrgRole) ||
344 !
string.IsNullOrEmpty(this.OrgAddress) ||
345 !
string.IsNullOrEmpty(this.OrgAddress2) ||
346 !
string.IsNullOrEmpty(this.OrgZipCode) ||
347 !
string.IsNullOrEmpty(this.OrgArea) ||
348 !
string.IsNullOrEmpty(this.OrgCity) ||
349 !
string.IsNullOrEmpty(this.OrgRegion) ||
350 !
string.IsNullOrEmpty(this.OrgCountryCode);
351 this.IsApproved = this.identity.State ==
IdentityState.Approved;
358 this.Created = DateTime.MinValue;
359 this.Updated = DateTime.MinValue;
377 this.BirthDate =
null;
390 this.IsApproved =
false;
395 if (this.clientSignature is not
null)
397 this.Role = this.clientSignature.
Role;
398 this.Timestamp = this.clientSignature.
Timestamp.ToString(CultureInfo.CurrentCulture);
399 this.IsTransferable = this.clientSignature.
Transferable.ToYesNo();
400 this.BareJid = this.clientSignature.
BareJid;
401 this.Signature = Convert.ToBase64String(this.clientSignature.
DigitalSignature);
416 private static async Task Copy(
object Item)
420 if (Item is
string Label)
421 await Clipboard.SetTextAsync(Label);
423 await Clipboard.SetTextAsync(Item?.
ToString() ??
string.Empty);
436 #region ILinkableView
451 public string Link => Constants.UriSchemes.IotId +
":" + this.LegalId;
456 public Task<string>
Title => this.GetTitle();
458 private async Task<string> GetTitle()
460 if (this.identity is
null)
XMPP Protocol Properties.
const string PersonalNumber
Personal number
const string OrgAddress2
Organization Address line 2
const string Country
Country
const string OrgArea
Organization Area
const string Region
Region
const string OrgRegion
Organization Region
const string Nationality
Nationality
const string ZipCode
Zip Code
const string BirthYear
Birth Year
const string OrgCity
Organization City
const string OrgRole
Organization Role
const string Phone
Phone number
const string EMail
e-Mail address
const string OrgZipCode
Organization Zip Code
const string MiddleNames
Middle names
const string BirthDay
Birth Day
const string OrgCountry
Organization Country
const string OrgDepartment
Organization Department
const string Address2
Address line 2
const string OrgAddress
Organization Address line 1
const string Address
Address line 1
const string LastNames
Last names
const string OrgNumber
Organization number
const string BirthMonth
Birth Month
const string FirstName
First name
const string Gender
Gender
const string OrgName
Organization name
A set of never changing property constants and helpful values.
const string NotAvailableValue
A generic "no value available" string.
Base class that references services in the app.
static ILogService LogService
Log service.
static IUiService UiService
Service serializing and managing UI-related tasks.
static IStringLocalizer Localizer
Localization service
A base class for all view models, inheriting from the BindableObject. NOTE: using this class requir...
Holds navigation parameters specific to views displaying a client signature.
LegalIdentity? Identity
The legal identity to display.
Waher.Networking.XMPP.Contracts.? ClientSignature Signature
The signature to display.
The view model to bind to for when displaying client signatures.
ClientSignatureViewModel(ClientSignatureNavigationArgs? Args)
Creates an instance of the ClientSignatureViewModel class.
override async Task OnInitialize()
Method called when view is initialized for the first time. Use this method to implement registration ...
bool HasMedia
If linkable view has media associated with link.
byte?[] Media
Encoded media, if available.
Task< string > Title
Title of the current view
bool IsLinkable
If the current view is linkable.
string Link
Link to the current view
string? MediaContentType
Content-Type of associated media.
bool EncodeAppLinks
If App links should be encoded with the link.
Represents a digital signature on a contract.
string Role
Role of the legal identity in the contract.
bool Transferable
If the signature is transferable to contracts based on the current contract as a template,...
string BareJid
Bare JID of the client used to generate the signature.
byte[] DigitalSignature
Digital Signature
DateTime Timestamp
Timestamp of signature.
Interface for linkable views.
delegate string ToString(IElement Element)
Delegate for callback methods that convert an element value to a string.
IdentityState
Lists recognized legal identity states.