1using CommunityToolkit.Mvvm.ComponentModel;
2using CommunityToolkit.Mvvm.Input;
33 this.UpdateProperties();
35 ServiceRef.TagProfile.OnPropertiesChanged += this.TagProfile_OnPropertiesChanged;
36 ServiceRef.XmppService.OnRosterItemAdded += this.XmppService_OnRosterItemAdded;
37 ServiceRef.XmppService.OnRosterItemRemoved += this.XmppService_OnRosterItemRemoved;
38 ServiceRef.XmppService.ConnectionStateChanged += this.XmppService_ConnectionStateChanged;
40 return base.OnInitialize();
46 ServiceRef.TagProfile.OnPropertiesChanged -= this.TagProfile_OnPropertiesChanged;
47 ServiceRef.XmppService.OnRosterItemAdded -= this.XmppService_OnRosterItemAdded;
48 ServiceRef.XmppService.OnRosterItemRemoved -= this.XmppService_OnRosterItemRemoved;
49 ServiceRef.XmppService.ConnectionStateChanged -= this.XmppService_ConnectionStateChanged;
51 return base.OnDispose();
54 private void TagProfile_OnPropertiesChanged(
object? sender, EventArgs e)
56 this.UpdateProperties();
59 private Task XmppService_ConnectionStateChanged(
object Sender,
Waher.
Networking.
XMPP.XmppState NewState)
62 this.UpdateProperties();
64 return Task.CompletedTask;
69 this.UpdateProperties();
71 return Task.CompletedTask;
76 this.UpdateProperties();
78 return Task.CompletedTask;
81 private void UpdateProperties()
85 this.CanShowCreateTokenCommand =
ServiceRef.
TagProfile.HasContractTokenCreationTemplatesReferences;
86 this.CanShowContactsCommand = ServiceRef.XmppService.Roster is not
null && ServiceRef.XmppService.Roster.Length > 0;
96 private static async Task Close()
100 AppShell.Current.FlyoutIsPresented =
false;
113 private static async Task ViewId()
130 private static async Task ShowSettings()
146 private static async Task ShowApplications()
162 private bool canShowMyContractsCommand;
165 private static async Task ShowMyContracts()
182 private bool canShowCreateContractCommand;
185 private static async Task CreateContract()
202 private bool canShowCreateTokenCommand;
205 private static async Task CreateToken()
222 private bool canShowContactsCommand;
225 private static async Task ShowContacts()
242 private bool canShowWalletCommand;
245 internal static async Task ShowWallet()
265 private bool canShowThingsCommand;
268 private static async Task ShowThings()
Contains information about a balance.
Contains information about a pending payment.
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 int AccountEventBatchSize
Number of account events to load in a single batch.
A set of never changing property constants and helpful values.
Base class that references services in the app.
static ILogService LogService
Log service.
static IUiService UiService
Service serializing and managing UI-related tasks.
static ITagProfile TagProfile
TAG Profile 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...
Holds navigation parameters specific to views displaying a list of contacts.
A page that displays a list of the current user's contacts.
Holds navigation parameters specific to views displaying a list of contacts.
A page that displays a list of the current user's contracts.
A page to display when the user wants to view an identity.
View model for the AppShell.
override Task OnInitialize()
Method called when view is initialized for the first time. Use this method to implement registration ...
AppShellViewModel()
View model for the AppShell.
override Task OnDispose()
Method called when the view is disposed, and will not be used more. Use this method to unregister eve...
Main page for App settings.
A page that displays a list of the current user's things.
A page that allows the user to view the contents of its eDaler wallet, pending payments and recent ac...
Holds navigation parameters specific to the eDaler wallet.
Maintains information about an item in the roster.
Task DisplayException(Exception Exception, string? Title=null)
Displays an alert/message box to the user.
Task GoToAsync(string Route, BackMethod BackMethod=BackMethod.Inherited, string? UniqueId=null)
Navigates the AppShell to the specified route, with page arguments to match.
BackMethod
Navigation Back Method
ContractsListMode
What list of contracts to display
AuthenticationPurpose
Purpose for requesting the user to authenticate itself.