3using System.Collections.ObjectModel;
6using System.Threading.Tasks;
7using CommunityToolkit.Mvvm.ComponentModel;
8using CommunityToolkit.Mvvm.Input;
29 ServiceRef.XmppService.PetitionedIdentityResponseReceived += this.XmppService_OnPetitionedIdentityResponseReceived;
35 ServiceRef.XmppService.PetitionedIdentityResponseReceived += this.XmppService_OnPetitionedIdentityResponseReceived;
36 this.Signature = signature;
47 this.FriendlyName = await this.GetFriendlyNameAsync();
49 await this.PetitionIdentityAsync();
55 this.identity = Identity;
59 MainThread.BeginInvokeOnMainThread(() =>
61 this.OnPropertyChanged(nameof(this.HasIdentity));
84 MainThread.BeginInvokeOnMainThread(() =>
87 this.HasSentPetition =
false;
88 this.OnPropertyChanged(nameof(this.HasIdentity));
89 this.OnPropertyChanged(nameof(this.CanSendProposal));
90 this.OnPropertyChanged(nameof(this.HasSentPetition));
95 private async Task PetitionIdentityAsync()
100 string FriendlyName = await this.GetFriendlyNameAsync();
102 MainThread.BeginInvokeOnMainThread(() =>
105 if (this.identity is
null)
106 this.HasSentPetition =
true;
107 this.OnPropertyChanged(nameof(this.HasIdentity));
108 this.OnPropertyChanged(nameof(this.CanSendProposal));
109 this.OnPropertyChanged(nameof(this.HasSentPetition));
115 private async Task<string> GetFriendlyNameAsync()
126 if (Info is not
null && !
string.IsNullOrEmpty(Info.
FriendlyName))
129 if (this.identity is not
null)
132 if (Info is not
null && !
string.IsNullOrEmpty(Info.
BareJid))
157 get => this.signature;
160 this.SetProperty(ref this.signature, value);
161 this.OnPropertyChanged(nameof(this.HasSigned));
162 this.OnPropertyChanged(nameof(this.CanSendProposal));
163 this.OpenSignatureCommand.NotifyCanExecuteChanged();
178 get => this.friendlyName;
181 this.SetProperty(ref this.friendlyName, value);
184 private string? friendlyName =
string.Empty;
186 public bool HasSentPetition
188 get => this.hasSentPetition && !this.HasIdentity;
191 this.SetProperty(ref this.hasSentPetition, value);
194 private bool hasSentPetition =
false;
197 public bool IsThirdParty => !this.IsMe;
199 public bool HasIdentity => this.identity is not
null;
201 public bool HasSigned => this.Signature is not
null;
203 public bool CanSendProposal => this.IsThirdParty && this.HasIdentity && !this.HasSigned && this.Role !=
"TrustProvider";
210 get => this.isPresetFromArgs;
213 if (this.SetProperty(ref this.isPresetFromArgs, value))
220 private bool isPresetFromArgs =
false;
236 [RelayCommand(AllowConcurrentExecutions =
false)]
237 private async Task OpenIdentityAsync()
239 if (this.identity is
null)
243 await this.PetitionIdentityAsync();
257 [RelayCommand(AllowConcurrentExecutions =
false, CanExecute = nameof(HasSigned))]
258 private async Task OpenSignatureAsync()
264 Services.UI.BackMethod.Pop);
269 private bool disposed =
false;
271 #region IDisposable Support
272 public void Dispose()
275 GC.SuppressFinalize(
this);
278 protected virtual void Dispose(
bool disposing)
286 ServiceRef.XmppService.PetitionedIdentityResponseReceived -= this.XmppService_OnPetitionedIdentityResponseReceived;
289 this.disposed =
true;
A strongly-typed resource class, for looking up localized strings, etc.
static string Petition
Looks up a localized string similar to Request.
static string Me
Looks up a localized string similar to (me).
static string PetitionIdentitySent
Looks up a localized string similar to A request to view ID has been sent.
static string Ok
Looks up a localized string similar to OK.
static string SomethingWentWrong
Looks up a localized string similar to Something went wrong.
static string Error
Looks up a localized string similar to Error.
static string ForInclusionInContract
Looks up a localized string similar to For inclusion as part in a contract..
Base class that references services in the app.
static ILogService LogService
Log service.
static IUiService UiService
Service serializing and managing UI-related tasks.
static INavigationService NavigationService
The navigation service for navigating between pages.
static ITagProfile TagProfile
TAG Profile service.
static IContractOrchestratorService ContractOrchestratorService
Contract orchestrator service.
static IReportingStringLocalizer Localizer
Localization service
static IXmppService XmppService
The XMPP service for XMPP communication.
bool ShowRemoveAsThirdParty
Helper property for XAML: show the remove cross for third-party parts if not preset from args.
bool IsPresetFromArgs
True if this part was preselected via navigation args and therefore should not be removable in the Ro...
async Task InitializeAsync(bool sendPetition=true)
Initializes the part, setting properties which needs to be set asynchronosly
string? FriendlyName
The friendly name for the part Has to be initialized with InitializeAsync
bool ShowRemoveAsMe
Helper property for XAML: show the remove cross for "me" parts if not preset from args.
A page to display when the user wants to view an identity.
Holds navigation parameters specific to views displaying a client signature.
A page that displays a client signature.
Represents a digital signature on a contract.
Event arguments for legal identity petition responses
LegalIdentity RequestedIdentity
Requested identity, if accepted, null if rejected.
string Id
ID of the legal identity
Class defining a part in a contract
string LegalId
Legal identity of part
string Role
Role of the part in the contract
Abstract base class of signatures
Static interface for database persistence. In order to work, a database provider has to be assigned t...
This filter selects objects that have a named field equal to a given value.