Back to results for “App Lifecycle”
.NET MAUI › App Lifecycle & Windows

How do the App and Window lifecycle events relate?

Intermediate

Answer

The Application creates Windows; each Window raises Created, Activated, Deactivated, Stopped, Resumed, and Destroying. App-level state changes map to the active window's events. Use them for app-wide concerns (persist on Stopped, refresh on Resumed), while page OnAppearing/OnDisappearing handle per-screen concerns.
window.Activated   += (s, e) => _analytics.TrackForeground();
window.Deactivated += (s, e) => _analytics.TrackBackground();
Real-world example Analytics logs foreground/background transitions from window Activated/Deactivated events across the whole app.

Common follow-ups: Window events vs page events? | Which fires when backgrounded?