Agent skill

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

dotnetgithub.com/dotnetGitHub ↗
claude-codeMIT
Install
npx skills add dotnet/skills --skill maui-app-lifecycle --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 2
SKILL.md size: 9 KB
Bundled scripts: none
Path: plugins/dotnet-maui/skills/maui-app-lifecycle/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 4,927
Language: C#
Read our review of the source →

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# .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

What's inside
Steps it walks through
  1. When to Use
  2. When Not to Use
  3. Inputs
  4. App States
  5. Window Lifecycle Events
  6. Subscribing via CreateWindow
  7. Subscribing via a Custom Window Subclass
  8. Workflow: Save and Restore State on Background
  9. Platform Lifecycle Mapping
  10. Android
  11. iOS / Mac Catalyst
  12. Windows (WinUI)
  13. Hooking Native Lifecycle Directly
  14. Common Pitfalls
Ships with 1 file
  • references/lifecycle-api.md
More from skills
All skills →
About this skill
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.

Keep going