1using Microsoft.Maui.Controls.PlatformConfiguration;
2using Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific;
7using System.Reflection;
21 if (BindingContext is T vm)
23 throw new InvalidOperationException($
"Expected BindingContext of type {typeof(T).Name}, but got {BindingContext?.GetType().Name ?? "null"}");
31 get => this.ViewModel<BaseViewModel>();
32 set => this.BindingContext = value;
55 this.SetDynamicResource(
Microsoft.Maui.Controls.VisualElement.BackgroundColorProperty,
"SurfaceBackgroundWL");
67 await vm.OnInitializeAsync();
76 await vm.OnDisposeAsync();
90 await vm.OnAppearingAsync();
92 await vm.RestoreState();
116 await vm.SaveState();
118 await vm.OnDisappearingAsync();
Represents an instance of the Neuro-Access app.
static Task ServicesReady
Task that completes once all core services have finished loading.
Base class that references services in the app.
static ILogService LogService
Log service.
static ISettingsService SettingsService
Settings service.
A base class for all pages, intended for custom navigation with explicit life-cycle events.
virtual async Task OnAppearingAsync()
Called when the page is about to be shown. Triggers restore state, appearing logic,...
virtual async Task OnInitializeAsync()
Override to register event handlers, process navigation args, etc. Called ONCE per page lifetime.
bool IsInitialized
True if this page is initialized (see ILifeCycleView).
bool IsAppearing
True if this page is currently visible/appearing (see ILifeCycleView).
EventHandlerAsync? OnAfterDisappearing
Event raised after page disappears.
T ViewModel< T >()
Access the page's strongly-typed view model.
virtual async Task OnDisappearingAsync()
Called when the page is about to be hidden. Triggers save state, disappearing logic,...
virtual ? string UniqueId
Gets or sets a unique identifier for distinguishing this page from others of the same type.
virtual async Task OnDisposeAsync()
Override to unregister event handlers, cleanup, etc. Called when page is permanently removed.
EventHandlerAsync? OnBeforeAppearing
Event raised before page appears.
BaseViewModel ContentPageModel
Convenience property for accessing the BindingContext as a BaseViewModel.
BaseContentPage()
Initializes the page with platform safe-area and default background.
A base class for all view models, inheriting from the BindableObject. NOTE: using this class requir...
Interface for views who need to react to life-cycle events.
delegate Task EventHandlerAsync(object Sender, EventArgs e)
Asynchronous version of EventArgs.