maui-app-lifecycle
.NET MAUI app lifecycle guidance — the four app states, cross-platform Window lifecycle events (Created, Activated, Deactivated, Stopped, Resumed, Destroying), platform-specific lifecycle mapping, backgrounding and resume behavior, and state-preservation patterns. USE FOR: "app lifecycle", "window lifecycle events", "save state on background", "resume app", "OnStopped", "OnResumed", "backgrounding", "deactivated event", "ConfigureLifecycleEvents", "platform lifecycle hooks". DO NOT USE FOR: navigation events (use maui-shell-navigation), dependency injection setup (use maui-dependency-injection
npx skills add dotnet/skills --skill maui-app-lifecycle --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# .NET MAUI App Lifecycle Handle application state transitions correctly in .NET MAUI. This skill covers the cross-platform Window lifecycle events, their platform-native mappings, and patterns for preserving state across backgrounding and resume cycles. ## When to Use - Saving or restoring state when the app backgrounds or resumes - Subscribing to Window lifecycle events (Created, Activated, Deactivated, Stopped, Resumed, Destroying) - Hooking into platform-native lifecycle callbacks via `ConfigureLifecycleEvents` - Deciding where to place initialization, teardown, or refresh logic - Understanding the difference between Deactivated and Stopped ## When Not to Use - Page-level navigation events — use Shell navigation guidance instead - Registering services at startup — use dependency injection guidance instead - Calling platform-specific APIs outside lifecycle context — use platform invoke guidance instead ## Inputs - The target lifecycle transition (e.g., "save draft when backgrounded", "refresh data on resume") - Which platforms the developer targets (Android, iOS, Mac Catalyst, Windows) - Whether the app uses multiple windows (iPad, Mac Catalyst, desktop Windows) ## App States A
- When to Use
- When Not to Use
- Inputs
- App States
- Window Lifecycle Events
- Subscribing via CreateWindow
- Subscribing via a Custom Window Subclass
- Workflow: Save and Restore State on Background
- Platform Lifecycle Mapping
- Android
- iOS / Mac Catalyst
- Windows (WinUI)
- Hooking Native Lifecycle Directly
- Common Pitfalls
What does the maui-app-lifecycle skill do?
.NET MAUI app lifecycle guidance — the four app states, cross-platform Window lifecycle events (Created, Activated, Deactivated, Stopped, Resumed, Destroying), platform-specific lifecycle mapping, backgrounding and resume behavior, and state-preservation patterns. USE FOR: "app lifecycle", "window lifecycle events", "save state on background", "resume app", "OnStopped", "OnResumed", "backgrounding", "deactivated event", "ConfigureLifecycleEvents", "platform lifecycle hooks". DO NOT USE FOR: navigation events (use maui-shell-navigation), dependency injection setup (use maui-dependency-injection
How do I install it?
Run `npx skills add dotnet/skills --skill maui-app-lifecycle --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From dotnet/skills, a repository with 4,927 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
