2using System.Threading.Tasks;
4using Microsoft.Maui.Controls;
12 internal sealed
class AppWindow : Window
14 private readonly
App app;
15 private readonly IActivationState? activationState;
23 public AppWindow(
App app, Page rootPage, IActivationState? activationState)
27 this.activationState = activationState;
31 protected override void OnCreated()
34 this.app.HandleWindowCreated(this.activationState);
38 protected override void OnStopped()
41 this.FireAndForget(this.app.HandleWindowStoppedAsync);
45 protected override void OnResumed()
48 this.FireAndForget(this.app.HandleWindowResumedAsync);
52 protected override void OnDestroying()
55 this.FireAndForget(this.app.HandleWindowDestroyingAsync);
58 private void FireAndForget(Func<Task> lifecycleHandler)
60 _ = Task.Run(async () =>
64 await lifecycleHandler().ConfigureAwait(
false);
68 this.ReportLifecycleException(ex);
73 private void ReportLifecycleException(Exception ex)
81 System.Diagnostics.Debug.WriteLine(ex);
Represents an instance of the Neuro-Access app.
Base class that references services in the app.
static ILogService LogService
Log service.