1using CommunityToolkit.Mvvm.ComponentModel;
2using CommunityToolkit.Mvvm.Input;
8using System.Collections.ObjectModel;
18 private readonly
string? requestorFullJid;
19 private readonly
string? petitionId;
20 private readonly PhotosLoader photosLoader;
29 this.photosLoader =
new PhotosLoader(this.
Photos);
44 await base.OnInitialize();
46 this.AssignProperties();
52 private async
void LoadPhotos()
60 this.FirstPhotoSource = First?.Source;
61 this.FirstPhotoRotation = First?.Rotation ?? 0;
73 this.photosLoader.CancelLoadPhotos();
75 await base.OnDispose();
81 public ObservableCollection<Photo>
Photos {
get; }
97 private async Task Accept()
103 this.RequestedContract!.ContractId,
this.petitionId!,
this.requestorFullJid!,
true));
113 private async Task Decline()
116 this.RequestedContract!.ContractId,
this.petitionId!,
this.requestorFullJid!,
false));
126 private async Task Ignore()
140 private DateTime? created;
146 private DateTime? updated;
152 private DateTime? expires;
158 private string? legalId;
164 private string? networkId;
176 private DateTime? from;
182 private DateTime? to;
188 [NotifyPropertyChangedFor(nameof(FullName))]
189 private string? firstName;
195 [NotifyPropertyChangedFor(nameof(FullName))]
196 private string? middleNames;
202 [NotifyPropertyChangedFor(nameof(FullName))]
203 private string? lastNames;
209 private string? personalNumber;
215 private string? address;
221 private string? address2;
227 private string? zipCode;
233 private string? area;
239 private string? city;
245 private string? region;
251 private string? countryCode;
257 private string? nationalityCode;
263 private string? gender;
269 private DateTime? birthDate;
275 private string? orgName;
281 private string? orgNumber;
287 private string? orgDepartment;
293 private string? orgRole;
299 private string? orgAddress;
305 private string? orgAddress2;
311 private string? orgZipCode;
317 private string? orgArea;
323 private string? orgCity;
329 private string? orgRegion;
335 private string? orgCountryCode;
347 private bool hasPhotos;
353 private string? phoneNr;
359 private string? eMail;
365 private string? deviceId;
371 private bool isApproved;
377 private string? purpose;
383 private ImageSource? firstPhotoSource;
389 private int? firstPhotoRotation;
393 private void AssignProperties()
423 if (!
string.IsNullOrEmpty(BirthDayStr) &&
int.TryParse(BirthDayStr, out
int BirthDay) &&
424 !
string.IsNullOrEmpty(BirthMonthStr) &&
int.TryParse(BirthMonthStr, out
int BirthMonth) &&
425 !
string.IsNullOrEmpty(BirthYearStr) &&
int.TryParse(BirthYearStr, out
int BirthYear))
429 this.BirthDate =
new DateTime(BirthYear, BirthMonth, BirthDay);
434 this.BirthDate =
null;
450 !
string.IsNullOrEmpty(this.OrgName) ||
451 !
string.IsNullOrEmpty(this.OrgNumber) ||
452 !
string.IsNullOrEmpty(this.OrgDepartment) ||
453 !
string.IsNullOrEmpty(this.OrgRole) ||
454 !
string.IsNullOrEmpty(this.OrgAddress) ||
455 !
string.IsNullOrEmpty(this.OrgAddress2) ||
456 !
string.IsNullOrEmpty(this.OrgZipCode) ||
457 !
string.IsNullOrEmpty(this.OrgArea) ||
458 !
string.IsNullOrEmpty(this.OrgCity) ||
459 !
string.IsNullOrEmpty(this.OrgRegion) ||
460 !
string.IsNullOrEmpty(this.OrgCountryCode);
461 this.HasPhotos = this.Photos.Count > 0;
465 this.IsApproved = this.RequestorIdentity.State ==
IdentityState.Approved;
469 this.Created = DateTime.MinValue;
470 this.Updated = DateTime.MinValue;
486 this.NationalityCode =
string.Empty;
487 this.Gender =
string.Empty;
488 this.BirthDate =
null;
501 this.HasPhotos =
false;
505 this.IsApproved =
false;
513 private async Task Copy(
object Item)
517 if (Item is
string Label)
519 if (Label == this.LegalId)
528 await Clipboard.SetTextAsync(Label);
The Application class, representing an instance of the Neuro-Access app.
static Task< bool > AuthenticateUser(AuthenticationPurpose Purpose, bool Force=false)
Authenticates the user using the configured authentication method.
const string IotId
The IoT ID URI Scheme (iotid)
XMPP Protocol Properties.
const string PersonalNumber
Personal number
const string OrgAddress2
Organization Address line 2
const string DeviceId
Device ID
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 INetworkService NetworkService
Network service.
static IUiService UiService
Service serializing and managing UI-related tasks.
static IStringLocalizer Localizer
Localization service
static IXmppService XmppService
The XMPP service for XMPP communication.
A base class for all view models, inheriting from the BindableObject. NOTE: using this class requir...
virtual async Task GoBack()
Method called when user wants to navigate to the previous screen.
Holds navigation parameters specific to views displaying a contract petition request.
Contract? RequestedContract
The identity of the requestor.
LegalIdentity? RequestorIdentity
The identity of the requestor.
string? PetitionId
The petition id.
string? Purpose
The purpose of the petition.
string? RequestorFullJid
The identity of the requestor.
The view model to bind to when displaying petitioning of a contract in a view or page.
ObservableCollection< Photo > Photos
The list of photos related to the contract being petitioned.
override async Task OnDispose()
Method called when the view is disposed, and will not be used more. Use this method to unregister eve...
PetitionContractViewModel(PetitionContractNavigationArgs? Args)
Creates a new instance of the PetitionContractViewModel class.
LegalIdentity? RequestorIdentity
Requestor Identity object
override async Task OnInitialize()
Method called when view is initialized for the first time. Use this method to implement registration ...
Contract? RequestedContract
The contract to display.
Contains the definition of a contract
DateTime From
From what point in time the legal identity is valid.
DateTime Updated
When the identity object was last updated
DateTime To
To what point in time the legal identity is valid.
DateTime Created
When the identity object was created
IdentityState State
Current state of identity
string Id
ID of the legal identity
Attachment[] Attachments
Attachments assigned to the legal identity.
class Photo(byte[] Binary, int Rotation)
Class containing information about a photo.
AuthenticationPurpose
Purpose for requesting the user to authenticate itself.
IdentityState
Lists recognized legal identity states.
SignWith
Options on what keys to use when signing data.