maui-app-lifecycle

maui-app-lifecycle is a skill for Claude Code, Codex from managedcode/dotnet-skills. It costs 144 tokens per session (2,142 once invoked), scanned A, a copy of maui-app-lifecycle, MIT.

A guide to handling the stages of a .NET MAUI app window, such as opening, becoming active, moving to the background, returning, and closing.

In plain words
What is it for?
Use it to respond to lifecycle events, preserve data during backgrounding, refresh on resume, connect to platform-specific callbacks, and handle multiple windows.
Why use it?
It helps apps save state, refresh data, and start or clean up work at the correct time across different platforms.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to respond to lifecycle events, preserve data during backgrounding, refresh on resume, connect to platform-specific callbacks, and handle multiple windows.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/managedcode/dotnet-skills/maui-app-lifecycle
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add managedcode/dotnet-skills --skill maui-app-lifecycle
Clone the repo
git clone --depth 1 https://github.com/managedcode/dotnet-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for maui-app-lifecycle

README.md
[![agentmods](https://agentmods.dev/badge/skills/managedcode/dotnet-skills/maui-app-lifecycle/github.svg)](https://agentmods.dev/skills/managedcode/dotnet-skills/maui-app-lifecycle)
Your own site
<a href="https://agentmods.dev/skills/managedcode/dotnet-skills/maui-app-lifecycle"><img src="https://agentmods.dev/badge/skills/managedcode/dotnet-skills/maui-app-lifecycle/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for maui-app-lifecycle

Your own site · 80×15
<a href="https://agentmods.dev/skills/managedcode/dotnet-skills/maui-app-lifecycle"><img src="https://agentmods.dev/badge/skills/managedcode/dotnet-skills/maui-app-lifecycle.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 144 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,142 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00144 $0.02142
Opus 5.5 $0.00058 $0.00857
Sonnet 5.5 $0.00029 $0.00428
Haiku 4.5 $0.00014 $0.00214

Measured 2mo ago against content hash 88b2b00a9cc5, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

maui-app-lifecycle scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

100% identical to maui-app-lifecycle — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

catalog/Frameworks/Official-DotNet-MAUI/skills/maui-app-lifecycle/SKILL.md · 225 lines

How it starts

The opening of the file, as written. The whole thing — 225 lines — stays where its author put it; the contents beside it link to each section on GitHub.

.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 .NET MAUI app moves through four states:

State Description
Not Running Process does not exist
Running Foreground, receiving input
Deactivated Visible but lost focus (dialog, split-screen, notification shade)
Stopped Fully backgrounded, UI not visible

Typical flow: Not Running → Running → Deactivated → Stopped → Running (resumed) or Not Running (terminated).

Window Lifecycle Events

Microsoft.Maui.Controls.Window exposes six cross-platform events:

Event Fires when
Created Native window allocated
Activated Window receives input focus
Deactivated Window loses focus (may still be visible)
Stopped Window is no longer visible
Resumed Window returns to foreground after Stopped
Destroying Native window is being torn down

Read the full file on GitHub · 225 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 225 lines · 144 tokens per session scan A 88b2b00a9cc5

Subscribe to this mod's changes

maui-app-lifecycle is a skill published in the GitHub repository managedcode/dotnet-skills (496 stars, last pushed yesterday), licensed MIT. It adds 144 tokens to every session and 2,142 once invoked, about $0.0006 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 100% identical to maui-app-lifecycle, differing in 0 lines, and is treated as a copy.

Related

Other skills, from other repositories

xamarin-maui-framework-migration

Baseline migration skill for moving Xamarin.Forms solutions or copied modules to .NET MAUI using a create-new-project workflow.

syncfusion/xamarin-maui-migration-skills · 31 tokens

xamarin-maui-platform-specific-migration

Companion migration skill for Android, iOS, and Windows platform-specific tasks when moving Xamarin.Forms code to .NET MAUI.

syncfusion/xamarin-maui-migration-skills · 35 tokens

xamarin-maui-renderer-handler-migration

Companion migration skill for converting Xamarin.Forms custom renderers and effects to .NET MAUI handlers.

syncfusion/xamarin-maui-migration-skills · 30 tokens

android-java-bindings

Write and repair C# bindings for Java/Kotlin Android libraries with .NET for Android. USE FOR: direct/full AAR or JAR bindings, AndroidMavenLibrary, Metadata.xml, Additions, missing generated APIs, Kotlin JVM signatures, binding-generator warnings, CS0535/CS0738/CS0534, duplicate members, EventArgs, listener Handler…

dotnet/maui-labs · 134 tokens

android-slim-bindings

Create Android slim bindings for MAUI/.NET Android. USE FOR: Native Library Interop, thin Kotlin/Java wrapper design, building wrapper AARs with Gradle, Java-friendly callbacks, @JvmStatic, and dependencies of slim wrappers. DO NOT USE FOR: direct/full Java/Kotlin bindings or generated-code/Metadata.xml repairs (use…

dotnet/maui-labs · 96 tokens

maui-notifications-deep-links

Implement MAUI notifications and deep links. USE FOR: local/push notifications, FCM HTTP v1 migration, APNs/Azure Notification Hubs, permission UX, Android channels/POSTNOTIFICATIONS, iOS UNUserNotificationCenter, token lifecycle, notification tap navigation, app links/universal links/URI schemes. DO NOT USE FOR…

dotnet/maui-labs · 90 tokens