1using CommunityToolkit.Maui.Layouts;
2using CommunityToolkit.Mvvm.Messaging;
3using Microsoft.Maui.Controls.PlatformConfiguration;
4using Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific;
13 private bool registeredRegistrationPageMessage =
false;
14 private bool registeredKeyboardSizeMessage =
false;
18 this.InitializeComponent();
19 this.ContentPageModel = ViewModel;
25 this.ValidatePhoneView,
26 this.ValidateEmailView,
27 this.ChooseProviderView,
28 this.CreateAccountView,
29 this.DefinePasswordView,
32 this.ContactSupportView
37 this.registeredRegistrationPageMessage =
true;
39 StateContainer.SetCurrentState(this.GridWithAnimation,
"Loading");
44 if (this.registeredRegistrationPageMessage)
47 this.registeredRegistrationPageMessage =
false;
54 await base.OnAppearingAsync();
56 if (!this.registeredKeyboardSizeMessage)
58 WeakReferenceMessenger.Default.Register<
KeyboardSizeMessage>(
this, this.HandleKeyboardSizeMessage);
59 this.registeredKeyboardSizeMessage =
true;
66 if (this.registeredKeyboardSizeMessage)
69 this.registeredKeyboardSizeMessage =
false;
72 await base.OnDisappearingAsync();
81 if (
ServiceRef.PlatformSpecific.CanProhibitScreenCapture)
82 ServiceRef.PlatformSpecific.ProhibitScreenCapture =
true;
88 string NewState = NewStep.ToString();
90 if (
ServiceRef.PlatformSpecific.CanProhibitScreenCapture)
91 ServiceRef.PlatformSpecific.ProhibitScreenCapture =
true;
93 await this.Dispatcher.DispatchAsync(async () =>
97 string OldState = StateContainer.GetCurrentState(this.GridWithAnimation);
99 if (!
string.Equals(OldState, NewState, StringComparison.OrdinalIgnoreCase))
101 DateTime Start = DateTime.Now;
103 while (!StateContainer.GetCanStateChange(this.GridWithAnimation) && DateTime.Now.Subtract(Start).TotalSeconds < 2)
104 await Task.Delay(100);
106 await StateContainer.ChangeStateWithAnimation(this.GridWithAnimation, NewState, CancellationToken.None);
108 if (Recipient is RegistrationPage RegistrationPage)
110 RegistrationViewModel ViewModel = RegistrationPage.ViewModel<RegistrationViewModel>();
111 await ViewModel.DoAssignProperties(NewStep);
122 private async
void HandleKeyboardSizeMessage(
object Recipient,
KeyboardSizeMessage Message)
124 await this.Dispatcher.DispatchAsync(() =>
127 if (DeviceInfo.Platform == DevicePlatform.iOS)
129 Thickness SafeInsets = this.On<iOS>().SafeAreaInsets();
130 Bottom = SafeInsets.Bottom;
131 Thickness Margin = new(0, 0, 0, Message.KeyboardSize - Bottom);
132 this.TheMainGrid.Margin = Margin;
The Application class, representing an instance of the Neuro-Access app.
static Task SetMainPageAsync()
Switches the application to the main experience.
Base class that references services in the app.
static ILogService LogService
Log service.
override async Task OnDisappearingAsync()
override async Task OnAppearingAsync()
void SetPagesContainer(List< BaseRegistrationView > Items)
Adds sub-views
RegistrationStep
The different steps of a TAG Profile registration journey.
class KeyboardSizeMessage(float KeyboardSize)
Keyboard size change message
class RegistrationPageMessage(RegistrationStep Step)
RegistrationPage view change message