[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-dotnet-maui-app-lifecycle":3,"mdc-271y1t-key":34,"related-repo-dotnet-maui-app-lifecycle":1916,"related-org-dotnet-maui-app-lifecycle":2024},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":22,"repoUrl":23,"updatedAt":24,"license":25,"forks":26,"topics":27,"repo":29,"sourceUrl":32,"mdContent":33},"maui-app-lifecycle","manage .NET 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), platform API invocation (use conditional compilation and partial classes).",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},"dotnet",".NET (Microsoft)","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fdotnet.png",[12,16,19],{"name":13,"slug":14,"type":15},"MAUI","maui","tag",{"name":17,"slug":18,"type":15},".NET","net",{"name":20,"slug":21,"type":15},"Mobile","mobile",4576,"https:\u002F\u002Fgithub.com\u002Fdotnet\u002Fskills","2026-08-01T05:42:29.171173","MIT",332,[28],"agent-skills",{"repoUrl":23,"stars":22,"forks":26,"topics":30,"description":31},[28],"Repository for skills to assist AI coding agents with .NET and C#","https:\u002F\u002Fgithub.com\u002Fdotnet\u002Fskills\u002Ftree\u002FHEAD\u002Fplugins\u002Fdotnet-maui\u002Fskills\u002Fmaui-app-lifecycle","---\nname: maui-app-lifecycle\ndescription: >-\n  .NET MAUI app lifecycle guidance — the four app states, cross-platform Window\n  lifecycle events (Created, Activated, Deactivated, Stopped, Resumed, Destroying),\n  platform-specific lifecycle mapping, backgrounding and resume behavior, and\n  state-preservation patterns.\n  USE FOR: \"app lifecycle\", \"window lifecycle events\", \"save state on background\",\n  \"resume app\", \"OnStopped\", \"OnResumed\", \"backgrounding\", \"deactivated event\",\n  \"ConfigureLifecycleEvents\", \"platform lifecycle hooks\".\n  DO NOT USE FOR: navigation events (use maui-shell-navigation),\n  dependency injection setup (use maui-dependency-injection),\n  platform API invocation (use conditional compilation and partial classes).\nlicense: MIT\n---\n\n# .NET MAUI App Lifecycle\n\nHandle 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.\n\n## When to Use\n\n- Saving or restoring state when the app backgrounds or resumes\n- Subscribing to Window lifecycle events (Created, Activated, Deactivated, Stopped, Resumed, Destroying)\n- Hooking into platform-native lifecycle callbacks via `ConfigureLifecycleEvents`\n- Deciding where to place initialization, teardown, or refresh logic\n- Understanding the difference between Deactivated and Stopped\n\n## When Not to Use\n\n- Page-level navigation events — use Shell navigation guidance instead\n- Registering services at startup — use dependency injection guidance instead\n- Calling platform-specific APIs outside lifecycle context — use platform invoke guidance instead\n\n## Inputs\n\n- The target lifecycle transition (e.g., \"save draft when backgrounded\", \"refresh data on resume\")\n- Which platforms the developer targets (Android, iOS, Mac Catalyst, Windows)\n- Whether the app uses multiple windows (iPad, Mac Catalyst, desktop Windows)\n\n## App States\n\nA .NET MAUI app moves through four states:\n\n| State | Description |\n|---|---|\n| **Not Running** | Process does not exist |\n| **Running** | Foreground, receiving input |\n| **Deactivated** | Visible but lost focus (dialog, split-screen, notification shade) |\n| **Stopped** | Fully backgrounded, UI not visible |\n\nTypical flow: Not Running → Running → Deactivated → Stopped → Running (resumed) or Not Running (terminated).\n\n## Window Lifecycle Events\n\n`Microsoft.Maui.Controls.Window` exposes six cross-platform events:\n\n| Event | Fires when |\n|---|---|\n| `Created` | Native window allocated |\n| `Activated` | Window receives input focus |\n| `Deactivated` | Window loses focus (may still be visible) |\n| `Stopped` | Window is no longer visible |\n| `Resumed` | Window returns to foreground after Stopped |\n| `Destroying` | Native window is being torn down |\n\n### Subscribing via CreateWindow\n\nOverride `CreateWindow` in your `App` class and attach event handlers:\n\n```csharp\npublic partial class App : Application\n{\n    protected override Window CreateWindow(IActivationState? activationState)\n    {\n        var window = base.CreateWindow(activationState);\n\n        window.Created += (s, e) => Debug.WriteLine(\"Created\");\n        window.Activated += (s, e) => Debug.WriteLine(\"Activated\");\n        window.Deactivated += (s, e) => Debug.WriteLine(\"Deactivated\");\n        window.Stopped += (s, e) => Debug.WriteLine(\"Stopped\");\n        window.Resumed += (s, e) => Debug.WriteLine(\"Resumed\");\n        window.Destroying += (s, e) => Debug.WriteLine(\"Destroying\");\n\n        return window;\n    }\n}\n```\n\n### Subscribing via a Custom Window Subclass\n\nCreate a `Window` subclass and override the virtual methods:\n\n```csharp\npublic class AppWindow : Window\n{\n    public AppWindow(Page page) : base(page) { }\n\n    protected override void OnActivated() { \u002F* refresh UI *\u002F }\n    protected override void OnStopped() { \u002F* save state *\u002F }\n    protected override void OnResumed() { \u002F* restore state *\u002F }\n    protected override void OnDestroying() { \u002F* cleanup *\u002F }\n}\n```\n\nReturn it from `CreateWindow`:\n\n```csharp\nprotected override Window CreateWindow(IActivationState? activationState)\n    => new AppWindow(new AppShell());\n```\n\n## Workflow: Save and Restore State on Background\n\n1. **Identify transient state** — draft text, scroll position, form inputs, timer values.\n2. **Save in `OnStopped`** — use `Preferences` for small values or file serialization for larger state.\n3. **Restore in `OnResumed`** — read back saved values and apply to your view model.\n4. **Also save in `OnDestroying`** on Android — the back button can skip `Stopped` entirely.\n5. **Keep handlers fast** — complete within 1–2 seconds to avoid ANR on Android or watchdog kills on iOS.\n\n```csharp\nprotected override void OnStopped()\n{\n    base.OnStopped();\n    Preferences.Set(\"draft_text\", _viewModel.DraftText);\n    Preferences.Set(\"scroll_y\", _viewModel.ScrollY);\n}\n\nprotected override void OnResumed()\n{\n    base.OnResumed();\n    _viewModel.DraftText = Preferences.Get(\"draft_text\", string.Empty);\n    _viewModel.ScrollY = Preferences.Get(\"scroll_y\", 0.0);\n}\n\nprotected override void OnDestroying()\n{\n    base.OnDestroying();\n    \u002F\u002F Android back-button can skip Stopped\n    Preferences.Set(\"draft_text\", _viewModel.DraftText);\n}\n```\n\n## Platform Lifecycle Mapping\n\n### Android\n\n| Window Event | Android Callback |\n|---|---|\n| Created | `OnCreate` |\n| Activated | `OnResume` |\n| Deactivated | `OnPause` |\n| Stopped | `OnStop` |\n| Resumed | `OnRestart` → `OnStart` → `OnResume` |\n| Destroying | `OnDestroy` |\n\n### iOS \u002F Mac Catalyst\n\n| Window Event | UIKit Callback | `AddiOS` builder method |\n|---|---|---|\n| Created | `WillFinishLaunching` \u002F `SceneWillConnect` | `.WillFinishLaunching()` \u002F `.SceneWillConnect()` |\n| Activated | `DidBecomeActive` | `.OnActivated()` |\n| Deactivated | `WillResignActive` | `.OnResignActivation()` |\n| Stopped | `DidEnterBackground` | `.DidEnterBackground()` |\n| Resumed | `WillEnterForeground` | `.WillEnterForeground()` |\n| Destroying | `WillTerminate` | `.WillTerminate()` |\n\n> ⚠️ The UIKit selector names and the `AddiOS` builder method names differ for\n> activation. There is **no** `.DidBecomeActive()` or `.WillResignActive()` builder\n> method — use `.OnActivated()` and `.OnResignActivation()` or the code will not compile.\n\n### Windows (WinUI)\n\n| Window Event | WinUI Callback |\n|---|---|\n| Created | `OnLaunched` |\n| Activated | `Activated` (foreground) |\n| Deactivated | `Activated` (background) |\n| Stopped | `VisibilityChanged` (false) |\n| Resumed | `VisibilityChanged` (true) |\n| Destroying | `Closed` |\n\n## Hooking Native Lifecycle Directly\n\nUse `ConfigureLifecycleEvents` in `MauiProgram.cs` when you need platform-specific callbacks beyond what Window events provide:\n\n```csharp\nbuilder.ConfigureLifecycleEvents(events =>\n{\n#if ANDROID\n    events.AddAndroid(android => android\n        .OnCreate((activity, bundle) => Debug.WriteLine(\"Android OnCreate\"))\n        .OnResume(activity => Debug.WriteLine(\"Android OnResume\"))\n        .OnPause(activity => Debug.WriteLine(\"Android OnPause\"))\n        .OnStop(activity => Debug.WriteLine(\"Android OnStop\"))\n        .OnDestroy(activity => Debug.WriteLine(\"Android OnDestroy\")));\n#elif IOS || MACCATALYST\n    events.AddiOS(ios => ios\n        .OnActivated(app => Debug.WriteLine(\"iOS OnActivated\"))\n        .OnResignActivation(app => Debug.WriteLine(\"iOS OnResignActivation\"))\n        .DidEnterBackground(app => Debug.WriteLine(\"iOS DidEnterBackground\"))\n        .WillEnterForeground(app => Debug.WriteLine(\"iOS WillEnterForeground\")));\n#elif WINDOWS\n    events.AddWindows(windows => windows\n        .OnLaunched((app, args) => Debug.WriteLine(\"Windows OnLaunched\"))\n        .OnActivated((window, args) => Debug.WriteLine(\"Windows Activated\"))\n        .OnClosed((window, args) => Debug.WriteLine(\"Windows Closed\")));\n#endif\n});\n```\n\n## Common Pitfalls\n\n1. **Resumed does not fire on first launch.** The initial sequence is `Created` → `Activated`. Use `OnActivated` for logic that must run on every foreground entry, not `OnResumed`.\n\n2. **Deactivated ≠ Stopped.** A dialog, split-screen, or notification pull-down triggers `Deactivated` without `Stopped`. Do not perform heavy saves in `OnDeactivated` — the app may never actually background.\n\n3. **Android back button skips Stopped.** On Android, pressing back may call `Destroying` directly without `Stopped`. Place critical save logic in both `OnStopped` and `OnDestroying`.\n\n4. **Multi-window apps fire events independently.** On iPad, Mac Catalyst, and desktop Windows each `Window` instance fires its own lifecycle events. Do not assume a single global lifecycle.\n\n5. **Long-running handlers cause kills.** Android enforces a ~5 second ANR timeout; iOS has limited background execution time. Keep lifecycle handlers synchronous and fast — use `Preferences` for quick saves, not database writes.\n\n6. **Do not use legacy Xamarin.Forms lifecycle methods.** `Application.OnStart()`, `Application.OnSleep()`, and `Application.OnResume()` exist for backward compatibility but bypass Window-level events. In .NET MAUI, prefer `Window` lifecycle events (`OnActivated`, `OnStopped`, `OnResumed`, etc.) for correct multi-window behavior.\n",{"data":35,"body":36},{"name":4,"description":6,"license":25},{"type":37,"children":38},"root",[39,48,54,61,98,104,122,128,146,152,157,250,255,261,272,394,401,422,579,585,598,674,686,709,715,802,964,970,976,1108,1114,1311,1364,1370,1492,1498,1518,1702,1708,1910],{"type":40,"tag":41,"props":42,"children":44},"element","h1",{"id":43},"net-maui-app-lifecycle",[45],{"type":46,"value":47},"text",".NET MAUI App Lifecycle",{"type":40,"tag":49,"props":50,"children":51},"p",{},[52],{"type":46,"value":53},"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.",{"type":40,"tag":55,"props":56,"children":58},"h2",{"id":57},"when-to-use",[59],{"type":46,"value":60},"When to Use",{"type":40,"tag":62,"props":63,"children":64},"ul",{},[65,71,76,88,93],{"type":40,"tag":66,"props":67,"children":68},"li",{},[69],{"type":46,"value":70},"Saving or restoring state when the app backgrounds or resumes",{"type":40,"tag":66,"props":72,"children":73},{},[74],{"type":46,"value":75},"Subscribing to Window lifecycle events (Created, Activated, Deactivated, Stopped, Resumed, Destroying)",{"type":40,"tag":66,"props":77,"children":78},{},[79,81],{"type":46,"value":80},"Hooking into platform-native lifecycle callbacks via ",{"type":40,"tag":82,"props":83,"children":85},"code",{"className":84},[],[86],{"type":46,"value":87},"ConfigureLifecycleEvents",{"type":40,"tag":66,"props":89,"children":90},{},[91],{"type":46,"value":92},"Deciding where to place initialization, teardown, or refresh logic",{"type":40,"tag":66,"props":94,"children":95},{},[96],{"type":46,"value":97},"Understanding the difference between Deactivated and Stopped",{"type":40,"tag":55,"props":99,"children":101},{"id":100},"when-not-to-use",[102],{"type":46,"value":103},"When Not to Use",{"type":40,"tag":62,"props":105,"children":106},{},[107,112,117],{"type":40,"tag":66,"props":108,"children":109},{},[110],{"type":46,"value":111},"Page-level navigation events — use Shell navigation guidance instead",{"type":40,"tag":66,"props":113,"children":114},{},[115],{"type":46,"value":116},"Registering services at startup — use dependency injection guidance instead",{"type":40,"tag":66,"props":118,"children":119},{},[120],{"type":46,"value":121},"Calling platform-specific APIs outside lifecycle context — use platform invoke guidance instead",{"type":40,"tag":55,"props":123,"children":125},{"id":124},"inputs",[126],{"type":46,"value":127},"Inputs",{"type":40,"tag":62,"props":129,"children":130},{},[131,136,141],{"type":40,"tag":66,"props":132,"children":133},{},[134],{"type":46,"value":135},"The target lifecycle transition (e.g., \"save draft when backgrounded\", \"refresh data on resume\")",{"type":40,"tag":66,"props":137,"children":138},{},[139],{"type":46,"value":140},"Which platforms the developer targets (Android, iOS, Mac Catalyst, Windows)",{"type":40,"tag":66,"props":142,"children":143},{},[144],{"type":46,"value":145},"Whether the app uses multiple windows (iPad, Mac Catalyst, desktop Windows)",{"type":40,"tag":55,"props":147,"children":149},{"id":148},"app-states",[150],{"type":46,"value":151},"App States",{"type":40,"tag":49,"props":153,"children":154},{},[155],{"type":46,"value":156},"A .NET MAUI app moves through four states:",{"type":40,"tag":158,"props":159,"children":160},"table",{},[161,180],{"type":40,"tag":162,"props":163,"children":164},"thead",{},[165],{"type":40,"tag":166,"props":167,"children":168},"tr",{},[169,175],{"type":40,"tag":170,"props":171,"children":172},"th",{},[173],{"type":46,"value":174},"State",{"type":40,"tag":170,"props":176,"children":177},{},[178],{"type":46,"value":179},"Description",{"type":40,"tag":181,"props":182,"children":183},"tbody",{},[184,202,218,234],{"type":40,"tag":166,"props":185,"children":186},{},[187,197],{"type":40,"tag":188,"props":189,"children":190},"td",{},[191],{"type":40,"tag":192,"props":193,"children":194},"strong",{},[195],{"type":46,"value":196},"Not Running",{"type":40,"tag":188,"props":198,"children":199},{},[200],{"type":46,"value":201},"Process does not exist",{"type":40,"tag":166,"props":203,"children":204},{},[205,213],{"type":40,"tag":188,"props":206,"children":207},{},[208],{"type":40,"tag":192,"props":209,"children":210},{},[211],{"type":46,"value":212},"Running",{"type":40,"tag":188,"props":214,"children":215},{},[216],{"type":46,"value":217},"Foreground, receiving input",{"type":40,"tag":166,"props":219,"children":220},{},[221,229],{"type":40,"tag":188,"props":222,"children":223},{},[224],{"type":40,"tag":192,"props":225,"children":226},{},[227],{"type":46,"value":228},"Deactivated",{"type":40,"tag":188,"props":230,"children":231},{},[232],{"type":46,"value":233},"Visible but lost focus (dialog, split-screen, notification shade)",{"type":40,"tag":166,"props":235,"children":236},{},[237,245],{"type":40,"tag":188,"props":238,"children":239},{},[240],{"type":40,"tag":192,"props":241,"children":242},{},[243],{"type":46,"value":244},"Stopped",{"type":40,"tag":188,"props":246,"children":247},{},[248],{"type":46,"value":249},"Fully backgrounded, UI not visible",{"type":40,"tag":49,"props":251,"children":252},{},[253],{"type":46,"value":254},"Typical flow: Not Running → Running → Deactivated → Stopped → Running (resumed) or Not Running (terminated).",{"type":40,"tag":55,"props":256,"children":258},{"id":257},"window-lifecycle-events",[259],{"type":46,"value":260},"Window Lifecycle Events",{"type":40,"tag":49,"props":262,"children":263},{},[264,270],{"type":40,"tag":82,"props":265,"children":267},{"className":266},[],[268],{"type":46,"value":269},"Microsoft.Maui.Controls.Window",{"type":46,"value":271}," exposes six cross-platform events:",{"type":40,"tag":158,"props":273,"children":274},{},[275,291],{"type":40,"tag":162,"props":276,"children":277},{},[278],{"type":40,"tag":166,"props":279,"children":280},{},[281,286],{"type":40,"tag":170,"props":282,"children":283},{},[284],{"type":46,"value":285},"Event",{"type":40,"tag":170,"props":287,"children":288},{},[289],{"type":46,"value":290},"Fires when",{"type":40,"tag":181,"props":292,"children":293},{},[294,311,328,344,360,377],{"type":40,"tag":166,"props":295,"children":296},{},[297,306],{"type":40,"tag":188,"props":298,"children":299},{},[300],{"type":40,"tag":82,"props":301,"children":303},{"className":302},[],[304],{"type":46,"value":305},"Created",{"type":40,"tag":188,"props":307,"children":308},{},[309],{"type":46,"value":310},"Native window allocated",{"type":40,"tag":166,"props":312,"children":313},{},[314,323],{"type":40,"tag":188,"props":315,"children":316},{},[317],{"type":40,"tag":82,"props":318,"children":320},{"className":319},[],[321],{"type":46,"value":322},"Activated",{"type":40,"tag":188,"props":324,"children":325},{},[326],{"type":46,"value":327},"Window receives input focus",{"type":40,"tag":166,"props":329,"children":330},{},[331,339],{"type":40,"tag":188,"props":332,"children":333},{},[334],{"type":40,"tag":82,"props":335,"children":337},{"className":336},[],[338],{"type":46,"value":228},{"type":40,"tag":188,"props":340,"children":341},{},[342],{"type":46,"value":343},"Window loses focus (may still be visible)",{"type":40,"tag":166,"props":345,"children":346},{},[347,355],{"type":40,"tag":188,"props":348,"children":349},{},[350],{"type":40,"tag":82,"props":351,"children":353},{"className":352},[],[354],{"type":46,"value":244},{"type":40,"tag":188,"props":356,"children":357},{},[358],{"type":46,"value":359},"Window is no longer visible",{"type":40,"tag":166,"props":361,"children":362},{},[363,372],{"type":40,"tag":188,"props":364,"children":365},{},[366],{"type":40,"tag":82,"props":367,"children":369},{"className":368},[],[370],{"type":46,"value":371},"Resumed",{"type":40,"tag":188,"props":373,"children":374},{},[375],{"type":46,"value":376},"Window returns to foreground after Stopped",{"type":40,"tag":166,"props":378,"children":379},{},[380,389],{"type":40,"tag":188,"props":381,"children":382},{},[383],{"type":40,"tag":82,"props":384,"children":386},{"className":385},[],[387],{"type":46,"value":388},"Destroying",{"type":40,"tag":188,"props":390,"children":391},{},[392],{"type":46,"value":393},"Native window is being torn down",{"type":40,"tag":395,"props":396,"children":398},"h3",{"id":397},"subscribing-via-createwindow",[399],{"type":46,"value":400},"Subscribing via CreateWindow",{"type":40,"tag":49,"props":402,"children":403},{},[404,406,412,414,420],{"type":46,"value":405},"Override ",{"type":40,"tag":82,"props":407,"children":409},{"className":408},[],[410],{"type":46,"value":411},"CreateWindow",{"type":46,"value":413}," in your ",{"type":40,"tag":82,"props":415,"children":417},{"className":416},[],[418],{"type":46,"value":419},"App",{"type":46,"value":421}," class and attach event handlers:",{"type":40,"tag":423,"props":424,"children":429},"pre",{"className":425,"code":426,"language":427,"meta":428,"style":428},"language-csharp shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","public partial class App : Application\n{\n    protected override Window CreateWindow(IActivationState? activationState)\n    {\n        var window = base.CreateWindow(activationState);\n\n        window.Created += (s, e) => Debug.WriteLine(\"Created\");\n        window.Activated += (s, e) => Debug.WriteLine(\"Activated\");\n        window.Deactivated += (s, e) => Debug.WriteLine(\"Deactivated\");\n        window.Stopped += (s, e) => Debug.WriteLine(\"Stopped\");\n        window.Resumed += (s, e) => Debug.WriteLine(\"Resumed\");\n        window.Destroying += (s, e) => Debug.WriteLine(\"Destroying\");\n\n        return window;\n    }\n}\n","csharp","",[430],{"type":40,"tag":82,"props":431,"children":432},{"__ignoreMap":428},[433,444,453,462,471,480,490,499,508,517,526,535,544,552,561,570],{"type":40,"tag":434,"props":435,"children":438},"span",{"class":436,"line":437},"line",1,[439],{"type":40,"tag":434,"props":440,"children":441},{},[442],{"type":46,"value":443},"public partial class App : Application\n",{"type":40,"tag":434,"props":445,"children":447},{"class":436,"line":446},2,[448],{"type":40,"tag":434,"props":449,"children":450},{},[451],{"type":46,"value":452},"{\n",{"type":40,"tag":434,"props":454,"children":456},{"class":436,"line":455},3,[457],{"type":40,"tag":434,"props":458,"children":459},{},[460],{"type":46,"value":461},"    protected override Window CreateWindow(IActivationState? activationState)\n",{"type":40,"tag":434,"props":463,"children":465},{"class":436,"line":464},4,[466],{"type":40,"tag":434,"props":467,"children":468},{},[469],{"type":46,"value":470},"    {\n",{"type":40,"tag":434,"props":472,"children":474},{"class":436,"line":473},5,[475],{"type":40,"tag":434,"props":476,"children":477},{},[478],{"type":46,"value":479},"        var window = base.CreateWindow(activationState);\n",{"type":40,"tag":434,"props":481,"children":483},{"class":436,"line":482},6,[484],{"type":40,"tag":434,"props":485,"children":487},{"emptyLinePlaceholder":486},true,[488],{"type":46,"value":489},"\n",{"type":40,"tag":434,"props":491,"children":493},{"class":436,"line":492},7,[494],{"type":40,"tag":434,"props":495,"children":496},{},[497],{"type":46,"value":498},"        window.Created += (s, e) => Debug.WriteLine(\"Created\");\n",{"type":40,"tag":434,"props":500,"children":502},{"class":436,"line":501},8,[503],{"type":40,"tag":434,"props":504,"children":505},{},[506],{"type":46,"value":507},"        window.Activated += (s, e) => Debug.WriteLine(\"Activated\");\n",{"type":40,"tag":434,"props":509,"children":511},{"class":436,"line":510},9,[512],{"type":40,"tag":434,"props":513,"children":514},{},[515],{"type":46,"value":516},"        window.Deactivated += (s, e) => Debug.WriteLine(\"Deactivated\");\n",{"type":40,"tag":434,"props":518,"children":520},{"class":436,"line":519},10,[521],{"type":40,"tag":434,"props":522,"children":523},{},[524],{"type":46,"value":525},"        window.Stopped += (s, e) => Debug.WriteLine(\"Stopped\");\n",{"type":40,"tag":434,"props":527,"children":529},{"class":436,"line":528},11,[530],{"type":40,"tag":434,"props":531,"children":532},{},[533],{"type":46,"value":534},"        window.Resumed += (s, e) => Debug.WriteLine(\"Resumed\");\n",{"type":40,"tag":434,"props":536,"children":538},{"class":436,"line":537},12,[539],{"type":40,"tag":434,"props":540,"children":541},{},[542],{"type":46,"value":543},"        window.Destroying += (s, e) => Debug.WriteLine(\"Destroying\");\n",{"type":40,"tag":434,"props":545,"children":547},{"class":436,"line":546},13,[548],{"type":40,"tag":434,"props":549,"children":550},{"emptyLinePlaceholder":486},[551],{"type":46,"value":489},{"type":40,"tag":434,"props":553,"children":555},{"class":436,"line":554},14,[556],{"type":40,"tag":434,"props":557,"children":558},{},[559],{"type":46,"value":560},"        return window;\n",{"type":40,"tag":434,"props":562,"children":564},{"class":436,"line":563},15,[565],{"type":40,"tag":434,"props":566,"children":567},{},[568],{"type":46,"value":569},"    }\n",{"type":40,"tag":434,"props":571,"children":573},{"class":436,"line":572},16,[574],{"type":40,"tag":434,"props":575,"children":576},{},[577],{"type":46,"value":578},"}\n",{"type":40,"tag":395,"props":580,"children":582},{"id":581},"subscribing-via-a-custom-window-subclass",[583],{"type":46,"value":584},"Subscribing via a Custom Window Subclass",{"type":40,"tag":49,"props":586,"children":587},{},[588,590,596],{"type":46,"value":589},"Create a ",{"type":40,"tag":82,"props":591,"children":593},{"className":592},[],[594],{"type":46,"value":595},"Window",{"type":46,"value":597}," subclass and override the virtual methods:",{"type":40,"tag":423,"props":599,"children":601},{"className":425,"code":600,"language":427,"meta":428,"style":428},"public class AppWindow : Window\n{\n    public AppWindow(Page page) : base(page) { }\n\n    protected override void OnActivated() { \u002F* refresh UI *\u002F }\n    protected override void OnStopped() { \u002F* save state *\u002F }\n    protected override void OnResumed() { \u002F* restore state *\u002F }\n    protected override void OnDestroying() { \u002F* cleanup *\u002F }\n}\n",[602],{"type":40,"tag":82,"props":603,"children":604},{"__ignoreMap":428},[605,613,620,628,635,643,651,659,667],{"type":40,"tag":434,"props":606,"children":607},{"class":436,"line":437},[608],{"type":40,"tag":434,"props":609,"children":610},{},[611],{"type":46,"value":612},"public class AppWindow : Window\n",{"type":40,"tag":434,"props":614,"children":615},{"class":436,"line":446},[616],{"type":40,"tag":434,"props":617,"children":618},{},[619],{"type":46,"value":452},{"type":40,"tag":434,"props":621,"children":622},{"class":436,"line":455},[623],{"type":40,"tag":434,"props":624,"children":625},{},[626],{"type":46,"value":627},"    public AppWindow(Page page) : base(page) { }\n",{"type":40,"tag":434,"props":629,"children":630},{"class":436,"line":464},[631],{"type":40,"tag":434,"props":632,"children":633},{"emptyLinePlaceholder":486},[634],{"type":46,"value":489},{"type":40,"tag":434,"props":636,"children":637},{"class":436,"line":473},[638],{"type":40,"tag":434,"props":639,"children":640},{},[641],{"type":46,"value":642},"    protected override void OnActivated() { \u002F* refresh UI *\u002F }\n",{"type":40,"tag":434,"props":644,"children":645},{"class":436,"line":482},[646],{"type":40,"tag":434,"props":647,"children":648},{},[649],{"type":46,"value":650},"    protected override void OnStopped() { \u002F* save state *\u002F }\n",{"type":40,"tag":434,"props":652,"children":653},{"class":436,"line":492},[654],{"type":40,"tag":434,"props":655,"children":656},{},[657],{"type":46,"value":658},"    protected override void OnResumed() { \u002F* restore state *\u002F }\n",{"type":40,"tag":434,"props":660,"children":661},{"class":436,"line":501},[662],{"type":40,"tag":434,"props":663,"children":664},{},[665],{"type":46,"value":666},"    protected override void OnDestroying() { \u002F* cleanup *\u002F }\n",{"type":40,"tag":434,"props":668,"children":669},{"class":436,"line":510},[670],{"type":40,"tag":434,"props":671,"children":672},{},[673],{"type":46,"value":578},{"type":40,"tag":49,"props":675,"children":676},{},[677,679,684],{"type":46,"value":678},"Return it from ",{"type":40,"tag":82,"props":680,"children":682},{"className":681},[],[683],{"type":46,"value":411},{"type":46,"value":685},":",{"type":40,"tag":423,"props":687,"children":689},{"className":425,"code":688,"language":427,"meta":428,"style":428},"protected override Window CreateWindow(IActivationState? activationState)\n    => new AppWindow(new AppShell());\n",[690],{"type":40,"tag":82,"props":691,"children":692},{"__ignoreMap":428},[693,701],{"type":40,"tag":434,"props":694,"children":695},{"class":436,"line":437},[696],{"type":40,"tag":434,"props":697,"children":698},{},[699],{"type":46,"value":700},"protected override Window CreateWindow(IActivationState? activationState)\n",{"type":40,"tag":434,"props":702,"children":703},{"class":436,"line":446},[704],{"type":40,"tag":434,"props":705,"children":706},{},[707],{"type":46,"value":708},"    => new AppWindow(new AppShell());\n",{"type":40,"tag":55,"props":710,"children":712},{"id":711},"workflow-save-and-restore-state-on-background",[713],{"type":46,"value":714},"Workflow: Save and Restore State on Background",{"type":40,"tag":716,"props":717,"children":718},"ol",{},[719,729,753,769,792],{"type":40,"tag":66,"props":720,"children":721},{},[722,727],{"type":40,"tag":192,"props":723,"children":724},{},[725],{"type":46,"value":726},"Identify transient state",{"type":46,"value":728}," — draft text, scroll position, form inputs, timer values.",{"type":40,"tag":66,"props":730,"children":731},{},[732,743,745,751],{"type":40,"tag":192,"props":733,"children":734},{},[735,737],{"type":46,"value":736},"Save in ",{"type":40,"tag":82,"props":738,"children":740},{"className":739},[],[741],{"type":46,"value":742},"OnStopped",{"type":46,"value":744}," — use ",{"type":40,"tag":82,"props":746,"children":748},{"className":747},[],[749],{"type":46,"value":750},"Preferences",{"type":46,"value":752}," for small values or file serialization for larger state.",{"type":40,"tag":66,"props":754,"children":755},{},[756,767],{"type":40,"tag":192,"props":757,"children":758},{},[759,761],{"type":46,"value":760},"Restore in ",{"type":40,"tag":82,"props":762,"children":764},{"className":763},[],[765],{"type":46,"value":766},"OnResumed",{"type":46,"value":768}," — read back saved values and apply to your view model.",{"type":40,"tag":66,"props":770,"children":771},{},[772,783,785,790],{"type":40,"tag":192,"props":773,"children":774},{},[775,777],{"type":46,"value":776},"Also save in ",{"type":40,"tag":82,"props":778,"children":780},{"className":779},[],[781],{"type":46,"value":782},"OnDestroying",{"type":46,"value":784}," on Android — the back button can skip ",{"type":40,"tag":82,"props":786,"children":788},{"className":787},[],[789],{"type":46,"value":244},{"type":46,"value":791}," entirely.",{"type":40,"tag":66,"props":793,"children":794},{},[795,800],{"type":40,"tag":192,"props":796,"children":797},{},[798],{"type":46,"value":799},"Keep handlers fast",{"type":46,"value":801}," — complete within 1–2 seconds to avoid ANR on Android or watchdog kills on iOS.",{"type":40,"tag":423,"props":803,"children":805},{"className":425,"code":804,"language":427,"meta":428,"style":428},"protected override void OnStopped()\n{\n    base.OnStopped();\n    Preferences.Set(\"draft_text\", _viewModel.DraftText);\n    Preferences.Set(\"scroll_y\", _viewModel.ScrollY);\n}\n\nprotected override void OnResumed()\n{\n    base.OnResumed();\n    _viewModel.DraftText = Preferences.Get(\"draft_text\", string.Empty);\n    _viewModel.ScrollY = Preferences.Get(\"scroll_y\", 0.0);\n}\n\nprotected override void OnDestroying()\n{\n    base.OnDestroying();\n    \u002F\u002F Android back-button can skip Stopped\n    Preferences.Set(\"draft_text\", _viewModel.DraftText);\n}\n",[806],{"type":40,"tag":82,"props":807,"children":808},{"__ignoreMap":428},[809,817,824,832,840,848,855,862,870,877,885,893,901,908,915,923,930,939,948,956],{"type":40,"tag":434,"props":810,"children":811},{"class":436,"line":437},[812],{"type":40,"tag":434,"props":813,"children":814},{},[815],{"type":46,"value":816},"protected override void OnStopped()\n",{"type":40,"tag":434,"props":818,"children":819},{"class":436,"line":446},[820],{"type":40,"tag":434,"props":821,"children":822},{},[823],{"type":46,"value":452},{"type":40,"tag":434,"props":825,"children":826},{"class":436,"line":455},[827],{"type":40,"tag":434,"props":828,"children":829},{},[830],{"type":46,"value":831},"    base.OnStopped();\n",{"type":40,"tag":434,"props":833,"children":834},{"class":436,"line":464},[835],{"type":40,"tag":434,"props":836,"children":837},{},[838],{"type":46,"value":839},"    Preferences.Set(\"draft_text\", _viewModel.DraftText);\n",{"type":40,"tag":434,"props":841,"children":842},{"class":436,"line":473},[843],{"type":40,"tag":434,"props":844,"children":845},{},[846],{"type":46,"value":847},"    Preferences.Set(\"scroll_y\", _viewModel.ScrollY);\n",{"type":40,"tag":434,"props":849,"children":850},{"class":436,"line":482},[851],{"type":40,"tag":434,"props":852,"children":853},{},[854],{"type":46,"value":578},{"type":40,"tag":434,"props":856,"children":857},{"class":436,"line":492},[858],{"type":40,"tag":434,"props":859,"children":860},{"emptyLinePlaceholder":486},[861],{"type":46,"value":489},{"type":40,"tag":434,"props":863,"children":864},{"class":436,"line":501},[865],{"type":40,"tag":434,"props":866,"children":867},{},[868],{"type":46,"value":869},"protected override void OnResumed()\n",{"type":40,"tag":434,"props":871,"children":872},{"class":436,"line":510},[873],{"type":40,"tag":434,"props":874,"children":875},{},[876],{"type":46,"value":452},{"type":40,"tag":434,"props":878,"children":879},{"class":436,"line":519},[880],{"type":40,"tag":434,"props":881,"children":882},{},[883],{"type":46,"value":884},"    base.OnResumed();\n",{"type":40,"tag":434,"props":886,"children":887},{"class":436,"line":528},[888],{"type":40,"tag":434,"props":889,"children":890},{},[891],{"type":46,"value":892},"    _viewModel.DraftText = Preferences.Get(\"draft_text\", string.Empty);\n",{"type":40,"tag":434,"props":894,"children":895},{"class":436,"line":537},[896],{"type":40,"tag":434,"props":897,"children":898},{},[899],{"type":46,"value":900},"    _viewModel.ScrollY = Preferences.Get(\"scroll_y\", 0.0);\n",{"type":40,"tag":434,"props":902,"children":903},{"class":436,"line":546},[904],{"type":40,"tag":434,"props":905,"children":906},{},[907],{"type":46,"value":578},{"type":40,"tag":434,"props":909,"children":910},{"class":436,"line":554},[911],{"type":40,"tag":434,"props":912,"children":913},{"emptyLinePlaceholder":486},[914],{"type":46,"value":489},{"type":40,"tag":434,"props":916,"children":917},{"class":436,"line":563},[918],{"type":40,"tag":434,"props":919,"children":920},{},[921],{"type":46,"value":922},"protected override void OnDestroying()\n",{"type":40,"tag":434,"props":924,"children":925},{"class":436,"line":572},[926],{"type":40,"tag":434,"props":927,"children":928},{},[929],{"type":46,"value":452},{"type":40,"tag":434,"props":931,"children":933},{"class":436,"line":932},17,[934],{"type":40,"tag":434,"props":935,"children":936},{},[937],{"type":46,"value":938},"    base.OnDestroying();\n",{"type":40,"tag":434,"props":940,"children":942},{"class":436,"line":941},18,[943],{"type":40,"tag":434,"props":944,"children":945},{},[946],{"type":46,"value":947},"    \u002F\u002F Android back-button can skip Stopped\n",{"type":40,"tag":434,"props":949,"children":951},{"class":436,"line":950},19,[952],{"type":40,"tag":434,"props":953,"children":954},{},[955],{"type":46,"value":839},{"type":40,"tag":434,"props":957,"children":959},{"class":436,"line":958},20,[960],{"type":40,"tag":434,"props":961,"children":962},{},[963],{"type":46,"value":578},{"type":40,"tag":55,"props":965,"children":967},{"id":966},"platform-lifecycle-mapping",[968],{"type":46,"value":969},"Platform Lifecycle Mapping",{"type":40,"tag":395,"props":971,"children":973},{"id":972},"android",[974],{"type":46,"value":975},"Android",{"type":40,"tag":158,"props":977,"children":978},{},[979,995],{"type":40,"tag":162,"props":980,"children":981},{},[982],{"type":40,"tag":166,"props":983,"children":984},{},[985,990],{"type":40,"tag":170,"props":986,"children":987},{},[988],{"type":46,"value":989},"Window Event",{"type":40,"tag":170,"props":991,"children":992},{},[993],{"type":46,"value":994},"Android Callback",{"type":40,"tag":181,"props":996,"children":997},{},[998,1014,1030,1046,1062,1092],{"type":40,"tag":166,"props":999,"children":1000},{},[1001,1005],{"type":40,"tag":188,"props":1002,"children":1003},{},[1004],{"type":46,"value":305},{"type":40,"tag":188,"props":1006,"children":1007},{},[1008],{"type":40,"tag":82,"props":1009,"children":1011},{"className":1010},[],[1012],{"type":46,"value":1013},"OnCreate",{"type":40,"tag":166,"props":1015,"children":1016},{},[1017,1021],{"type":40,"tag":188,"props":1018,"children":1019},{},[1020],{"type":46,"value":322},{"type":40,"tag":188,"props":1022,"children":1023},{},[1024],{"type":40,"tag":82,"props":1025,"children":1027},{"className":1026},[],[1028],{"type":46,"value":1029},"OnResume",{"type":40,"tag":166,"props":1031,"children":1032},{},[1033,1037],{"type":40,"tag":188,"props":1034,"children":1035},{},[1036],{"type":46,"value":228},{"type":40,"tag":188,"props":1038,"children":1039},{},[1040],{"type":40,"tag":82,"props":1041,"children":1043},{"className":1042},[],[1044],{"type":46,"value":1045},"OnPause",{"type":40,"tag":166,"props":1047,"children":1048},{},[1049,1053],{"type":40,"tag":188,"props":1050,"children":1051},{},[1052],{"type":46,"value":244},{"type":40,"tag":188,"props":1054,"children":1055},{},[1056],{"type":40,"tag":82,"props":1057,"children":1059},{"className":1058},[],[1060],{"type":46,"value":1061},"OnStop",{"type":40,"tag":166,"props":1063,"children":1064},{},[1065,1069],{"type":40,"tag":188,"props":1066,"children":1067},{},[1068],{"type":46,"value":371},{"type":40,"tag":188,"props":1070,"children":1071},{},[1072,1078,1080,1086,1087],{"type":40,"tag":82,"props":1073,"children":1075},{"className":1074},[],[1076],{"type":46,"value":1077},"OnRestart",{"type":46,"value":1079}," → ",{"type":40,"tag":82,"props":1081,"children":1083},{"className":1082},[],[1084],{"type":46,"value":1085},"OnStart",{"type":46,"value":1079},{"type":40,"tag":82,"props":1088,"children":1090},{"className":1089},[],[1091],{"type":46,"value":1029},{"type":40,"tag":166,"props":1093,"children":1094},{},[1095,1099],{"type":40,"tag":188,"props":1096,"children":1097},{},[1098],{"type":46,"value":388},{"type":40,"tag":188,"props":1100,"children":1101},{},[1102],{"type":40,"tag":82,"props":1103,"children":1105},{"className":1104},[],[1106],{"type":46,"value":1107},"OnDestroy",{"type":40,"tag":395,"props":1109,"children":1111},{"id":1110},"ios-mac-catalyst",[1112],{"type":46,"value":1113},"iOS \u002F Mac Catalyst",{"type":40,"tag":158,"props":1115,"children":1116},{},[1117,1143],{"type":40,"tag":162,"props":1118,"children":1119},{},[1120],{"type":40,"tag":166,"props":1121,"children":1122},{},[1123,1127,1132],{"type":40,"tag":170,"props":1124,"children":1125},{},[1126],{"type":46,"value":989},{"type":40,"tag":170,"props":1128,"children":1129},{},[1130],{"type":46,"value":1131},"UIKit Callback",{"type":40,"tag":170,"props":1133,"children":1134},{},[1135,1141],{"type":40,"tag":82,"props":1136,"children":1138},{"className":1137},[],[1139],{"type":46,"value":1140},"AddiOS",{"type":46,"value":1142}," builder method",{"type":40,"tag":181,"props":1144,"children":1145},{},[1146,1186,1211,1236,1261,1286],{"type":40,"tag":166,"props":1147,"children":1148},{},[1149,1153,1170],{"type":40,"tag":188,"props":1150,"children":1151},{},[1152],{"type":46,"value":305},{"type":40,"tag":188,"props":1154,"children":1155},{},[1156,1162,1164],{"type":40,"tag":82,"props":1157,"children":1159},{"className":1158},[],[1160],{"type":46,"value":1161},"WillFinishLaunching",{"type":46,"value":1163}," \u002F ",{"type":40,"tag":82,"props":1165,"children":1167},{"className":1166},[],[1168],{"type":46,"value":1169},"SceneWillConnect",{"type":40,"tag":188,"props":1171,"children":1172},{},[1173,1179,1180],{"type":40,"tag":82,"props":1174,"children":1176},{"className":1175},[],[1177],{"type":46,"value":1178},".WillFinishLaunching()",{"type":46,"value":1163},{"type":40,"tag":82,"props":1181,"children":1183},{"className":1182},[],[1184],{"type":46,"value":1185},".SceneWillConnect()",{"type":40,"tag":166,"props":1187,"children":1188},{},[1189,1193,1202],{"type":40,"tag":188,"props":1190,"children":1191},{},[1192],{"type":46,"value":322},{"type":40,"tag":188,"props":1194,"children":1195},{},[1196],{"type":40,"tag":82,"props":1197,"children":1199},{"className":1198},[],[1200],{"type":46,"value":1201},"DidBecomeActive",{"type":40,"tag":188,"props":1203,"children":1204},{},[1205],{"type":40,"tag":82,"props":1206,"children":1208},{"className":1207},[],[1209],{"type":46,"value":1210},".OnActivated()",{"type":40,"tag":166,"props":1212,"children":1213},{},[1214,1218,1227],{"type":40,"tag":188,"props":1215,"children":1216},{},[1217],{"type":46,"value":228},{"type":40,"tag":188,"props":1219,"children":1220},{},[1221],{"type":40,"tag":82,"props":1222,"children":1224},{"className":1223},[],[1225],{"type":46,"value":1226},"WillResignActive",{"type":40,"tag":188,"props":1228,"children":1229},{},[1230],{"type":40,"tag":82,"props":1231,"children":1233},{"className":1232},[],[1234],{"type":46,"value":1235},".OnResignActivation()",{"type":40,"tag":166,"props":1237,"children":1238},{},[1239,1243,1252],{"type":40,"tag":188,"props":1240,"children":1241},{},[1242],{"type":46,"value":244},{"type":40,"tag":188,"props":1244,"children":1245},{},[1246],{"type":40,"tag":82,"props":1247,"children":1249},{"className":1248},[],[1250],{"type":46,"value":1251},"DidEnterBackground",{"type":40,"tag":188,"props":1253,"children":1254},{},[1255],{"type":40,"tag":82,"props":1256,"children":1258},{"className":1257},[],[1259],{"type":46,"value":1260},".DidEnterBackground()",{"type":40,"tag":166,"props":1262,"children":1263},{},[1264,1268,1277],{"type":40,"tag":188,"props":1265,"children":1266},{},[1267],{"type":46,"value":371},{"type":40,"tag":188,"props":1269,"children":1270},{},[1271],{"type":40,"tag":82,"props":1272,"children":1274},{"className":1273},[],[1275],{"type":46,"value":1276},"WillEnterForeground",{"type":40,"tag":188,"props":1278,"children":1279},{},[1280],{"type":40,"tag":82,"props":1281,"children":1283},{"className":1282},[],[1284],{"type":46,"value":1285},".WillEnterForeground()",{"type":40,"tag":166,"props":1287,"children":1288},{},[1289,1293,1302],{"type":40,"tag":188,"props":1290,"children":1291},{},[1292],{"type":46,"value":388},{"type":40,"tag":188,"props":1294,"children":1295},{},[1296],{"type":40,"tag":82,"props":1297,"children":1299},{"className":1298},[],[1300],{"type":46,"value":1301},"WillTerminate",{"type":40,"tag":188,"props":1303,"children":1304},{},[1305],{"type":40,"tag":82,"props":1306,"children":1308},{"className":1307},[],[1309],{"type":46,"value":1310},".WillTerminate()",{"type":40,"tag":1312,"props":1313,"children":1314},"blockquote",{},[1315],{"type":40,"tag":49,"props":1316,"children":1317},{},[1318,1320,1325,1327,1332,1334,1340,1342,1348,1350,1355,1357,1362],{"type":46,"value":1319},"⚠️ The UIKit selector names and the ",{"type":40,"tag":82,"props":1321,"children":1323},{"className":1322},[],[1324],{"type":46,"value":1140},{"type":46,"value":1326}," builder method names differ for\nactivation. There is ",{"type":40,"tag":192,"props":1328,"children":1329},{},[1330],{"type":46,"value":1331},"no",{"type":46,"value":1333}," ",{"type":40,"tag":82,"props":1335,"children":1337},{"className":1336},[],[1338],{"type":46,"value":1339},".DidBecomeActive()",{"type":46,"value":1341}," or ",{"type":40,"tag":82,"props":1343,"children":1345},{"className":1344},[],[1346],{"type":46,"value":1347},".WillResignActive()",{"type":46,"value":1349}," builder\nmethod — use ",{"type":40,"tag":82,"props":1351,"children":1353},{"className":1352},[],[1354],{"type":46,"value":1210},{"type":46,"value":1356}," and ",{"type":40,"tag":82,"props":1358,"children":1360},{"className":1359},[],[1361],{"type":46,"value":1235},{"type":46,"value":1363}," or the code will not compile.",{"type":40,"tag":395,"props":1365,"children":1367},{"id":1366},"windows-winui",[1368],{"type":46,"value":1369},"Windows (WinUI)",{"type":40,"tag":158,"props":1371,"children":1372},{},[1373,1388],{"type":40,"tag":162,"props":1374,"children":1375},{},[1376],{"type":40,"tag":166,"props":1377,"children":1378},{},[1379,1383],{"type":40,"tag":170,"props":1380,"children":1381},{},[1382],{"type":46,"value":989},{"type":40,"tag":170,"props":1384,"children":1385},{},[1386],{"type":46,"value":1387},"WinUI Callback",{"type":40,"tag":181,"props":1389,"children":1390},{},[1391,1407,1424,1441,1459,1476],{"type":40,"tag":166,"props":1392,"children":1393},{},[1394,1398],{"type":40,"tag":188,"props":1395,"children":1396},{},[1397],{"type":46,"value":305},{"type":40,"tag":188,"props":1399,"children":1400},{},[1401],{"type":40,"tag":82,"props":1402,"children":1404},{"className":1403},[],[1405],{"type":46,"value":1406},"OnLaunched",{"type":40,"tag":166,"props":1408,"children":1409},{},[1410,1414],{"type":40,"tag":188,"props":1411,"children":1412},{},[1413],{"type":46,"value":322},{"type":40,"tag":188,"props":1415,"children":1416},{},[1417,1422],{"type":40,"tag":82,"props":1418,"children":1420},{"className":1419},[],[1421],{"type":46,"value":322},{"type":46,"value":1423}," (foreground)",{"type":40,"tag":166,"props":1425,"children":1426},{},[1427,1431],{"type":40,"tag":188,"props":1428,"children":1429},{},[1430],{"type":46,"value":228},{"type":40,"tag":188,"props":1432,"children":1433},{},[1434,1439],{"type":40,"tag":82,"props":1435,"children":1437},{"className":1436},[],[1438],{"type":46,"value":322},{"type":46,"value":1440}," (background)",{"type":40,"tag":166,"props":1442,"children":1443},{},[1444,1448],{"type":40,"tag":188,"props":1445,"children":1446},{},[1447],{"type":46,"value":244},{"type":40,"tag":188,"props":1449,"children":1450},{},[1451,1457],{"type":40,"tag":82,"props":1452,"children":1454},{"className":1453},[],[1455],{"type":46,"value":1456},"VisibilityChanged",{"type":46,"value":1458}," (false)",{"type":40,"tag":166,"props":1460,"children":1461},{},[1462,1466],{"type":40,"tag":188,"props":1463,"children":1464},{},[1465],{"type":46,"value":371},{"type":40,"tag":188,"props":1467,"children":1468},{},[1469,1474],{"type":40,"tag":82,"props":1470,"children":1472},{"className":1471},[],[1473],{"type":46,"value":1456},{"type":46,"value":1475}," (true)",{"type":40,"tag":166,"props":1477,"children":1478},{},[1479,1483],{"type":40,"tag":188,"props":1480,"children":1481},{},[1482],{"type":46,"value":388},{"type":40,"tag":188,"props":1484,"children":1485},{},[1486],{"type":40,"tag":82,"props":1487,"children":1489},{"className":1488},[],[1490],{"type":46,"value":1491},"Closed",{"type":40,"tag":55,"props":1493,"children":1495},{"id":1494},"hooking-native-lifecycle-directly",[1496],{"type":46,"value":1497},"Hooking Native Lifecycle Directly",{"type":40,"tag":49,"props":1499,"children":1500},{},[1501,1503,1508,1510,1516],{"type":46,"value":1502},"Use ",{"type":40,"tag":82,"props":1504,"children":1506},{"className":1505},[],[1507],{"type":46,"value":87},{"type":46,"value":1509}," in ",{"type":40,"tag":82,"props":1511,"children":1513},{"className":1512},[],[1514],{"type":46,"value":1515},"MauiProgram.cs",{"type":46,"value":1517}," when you need platform-specific callbacks beyond what Window events provide:",{"type":40,"tag":423,"props":1519,"children":1521},{"className":425,"code":1520,"language":427,"meta":428,"style":428},"builder.ConfigureLifecycleEvents(events =>\n{\n#if ANDROID\n    events.AddAndroid(android => android\n        .OnCreate((activity, bundle) => Debug.WriteLine(\"Android OnCreate\"))\n        .OnResume(activity => Debug.WriteLine(\"Android OnResume\"))\n        .OnPause(activity => Debug.WriteLine(\"Android OnPause\"))\n        .OnStop(activity => Debug.WriteLine(\"Android OnStop\"))\n        .OnDestroy(activity => Debug.WriteLine(\"Android OnDestroy\")));\n#elif IOS || MACCATALYST\n    events.AddiOS(ios => ios\n        .OnActivated(app => Debug.WriteLine(\"iOS OnActivated\"))\n        .OnResignActivation(app => Debug.WriteLine(\"iOS OnResignActivation\"))\n        .DidEnterBackground(app => Debug.WriteLine(\"iOS DidEnterBackground\"))\n        .WillEnterForeground(app => Debug.WriteLine(\"iOS WillEnterForeground\")));\n#elif WINDOWS\n    events.AddWindows(windows => windows\n        .OnLaunched((app, args) => Debug.WriteLine(\"Windows OnLaunched\"))\n        .OnActivated((window, args) => Debug.WriteLine(\"Windows Activated\"))\n        .OnClosed((window, args) => Debug.WriteLine(\"Windows Closed\")));\n#endif\n});\n",[1522],{"type":40,"tag":82,"props":1523,"children":1524},{"__ignoreMap":428},[1525,1533,1540,1548,1556,1564,1572,1580,1588,1596,1604,1612,1620,1628,1636,1644,1652,1660,1668,1676,1684,1693],{"type":40,"tag":434,"props":1526,"children":1527},{"class":436,"line":437},[1528],{"type":40,"tag":434,"props":1529,"children":1530},{},[1531],{"type":46,"value":1532},"builder.ConfigureLifecycleEvents(events =>\n",{"type":40,"tag":434,"props":1534,"children":1535},{"class":436,"line":446},[1536],{"type":40,"tag":434,"props":1537,"children":1538},{},[1539],{"type":46,"value":452},{"type":40,"tag":434,"props":1541,"children":1542},{"class":436,"line":455},[1543],{"type":40,"tag":434,"props":1544,"children":1545},{},[1546],{"type":46,"value":1547},"#if ANDROID\n",{"type":40,"tag":434,"props":1549,"children":1550},{"class":436,"line":464},[1551],{"type":40,"tag":434,"props":1552,"children":1553},{},[1554],{"type":46,"value":1555},"    events.AddAndroid(android => android\n",{"type":40,"tag":434,"props":1557,"children":1558},{"class":436,"line":473},[1559],{"type":40,"tag":434,"props":1560,"children":1561},{},[1562],{"type":46,"value":1563},"        .OnCreate((activity, bundle) => Debug.WriteLine(\"Android OnCreate\"))\n",{"type":40,"tag":434,"props":1565,"children":1566},{"class":436,"line":482},[1567],{"type":40,"tag":434,"props":1568,"children":1569},{},[1570],{"type":46,"value":1571},"        .OnResume(activity => Debug.WriteLine(\"Android OnResume\"))\n",{"type":40,"tag":434,"props":1573,"children":1574},{"class":436,"line":492},[1575],{"type":40,"tag":434,"props":1576,"children":1577},{},[1578],{"type":46,"value":1579},"        .OnPause(activity => Debug.WriteLine(\"Android OnPause\"))\n",{"type":40,"tag":434,"props":1581,"children":1582},{"class":436,"line":501},[1583],{"type":40,"tag":434,"props":1584,"children":1585},{},[1586],{"type":46,"value":1587},"        .OnStop(activity => Debug.WriteLine(\"Android OnStop\"))\n",{"type":40,"tag":434,"props":1589,"children":1590},{"class":436,"line":510},[1591],{"type":40,"tag":434,"props":1592,"children":1593},{},[1594],{"type":46,"value":1595},"        .OnDestroy(activity => Debug.WriteLine(\"Android OnDestroy\")));\n",{"type":40,"tag":434,"props":1597,"children":1598},{"class":436,"line":519},[1599],{"type":40,"tag":434,"props":1600,"children":1601},{},[1602],{"type":46,"value":1603},"#elif IOS || MACCATALYST\n",{"type":40,"tag":434,"props":1605,"children":1606},{"class":436,"line":528},[1607],{"type":40,"tag":434,"props":1608,"children":1609},{},[1610],{"type":46,"value":1611},"    events.AddiOS(ios => ios\n",{"type":40,"tag":434,"props":1613,"children":1614},{"class":436,"line":537},[1615],{"type":40,"tag":434,"props":1616,"children":1617},{},[1618],{"type":46,"value":1619},"        .OnActivated(app => Debug.WriteLine(\"iOS OnActivated\"))\n",{"type":40,"tag":434,"props":1621,"children":1622},{"class":436,"line":546},[1623],{"type":40,"tag":434,"props":1624,"children":1625},{},[1626],{"type":46,"value":1627},"        .OnResignActivation(app => Debug.WriteLine(\"iOS OnResignActivation\"))\n",{"type":40,"tag":434,"props":1629,"children":1630},{"class":436,"line":554},[1631],{"type":40,"tag":434,"props":1632,"children":1633},{},[1634],{"type":46,"value":1635},"        .DidEnterBackground(app => Debug.WriteLine(\"iOS DidEnterBackground\"))\n",{"type":40,"tag":434,"props":1637,"children":1638},{"class":436,"line":563},[1639],{"type":40,"tag":434,"props":1640,"children":1641},{},[1642],{"type":46,"value":1643},"        .WillEnterForeground(app => Debug.WriteLine(\"iOS WillEnterForeground\")));\n",{"type":40,"tag":434,"props":1645,"children":1646},{"class":436,"line":572},[1647],{"type":40,"tag":434,"props":1648,"children":1649},{},[1650],{"type":46,"value":1651},"#elif WINDOWS\n",{"type":40,"tag":434,"props":1653,"children":1654},{"class":436,"line":932},[1655],{"type":40,"tag":434,"props":1656,"children":1657},{},[1658],{"type":46,"value":1659},"    events.AddWindows(windows => windows\n",{"type":40,"tag":434,"props":1661,"children":1662},{"class":436,"line":941},[1663],{"type":40,"tag":434,"props":1664,"children":1665},{},[1666],{"type":46,"value":1667},"        .OnLaunched((app, args) => Debug.WriteLine(\"Windows OnLaunched\"))\n",{"type":40,"tag":434,"props":1669,"children":1670},{"class":436,"line":950},[1671],{"type":40,"tag":434,"props":1672,"children":1673},{},[1674],{"type":46,"value":1675},"        .OnActivated((window, args) => Debug.WriteLine(\"Windows Activated\"))\n",{"type":40,"tag":434,"props":1677,"children":1678},{"class":436,"line":958},[1679],{"type":40,"tag":434,"props":1680,"children":1681},{},[1682],{"type":46,"value":1683},"        .OnClosed((window, args) => Debug.WriteLine(\"Windows Closed\")));\n",{"type":40,"tag":434,"props":1685,"children":1687},{"class":436,"line":1686},21,[1688],{"type":40,"tag":434,"props":1689,"children":1690},{},[1691],{"type":46,"value":1692},"#endif\n",{"type":40,"tag":434,"props":1694,"children":1696},{"class":436,"line":1695},22,[1697],{"type":40,"tag":434,"props":1698,"children":1699},{},[1700],{"type":46,"value":1701},"});\n",{"type":40,"tag":55,"props":1703,"children":1705},{"id":1704},"common-pitfalls",[1706],{"type":46,"value":1707},"Common Pitfalls",{"type":40,"tag":716,"props":1709,"children":1710},{},[1711,1749,1781,1817,1834,1851],{"type":40,"tag":66,"props":1712,"children":1713},{},[1714,1719,1721,1726,1727,1732,1734,1740,1742,1747],{"type":40,"tag":192,"props":1715,"children":1716},{},[1717],{"type":46,"value":1718},"Resumed does not fire on first launch.",{"type":46,"value":1720}," The initial sequence is ",{"type":40,"tag":82,"props":1722,"children":1724},{"className":1723},[],[1725],{"type":46,"value":305},{"type":46,"value":1079},{"type":40,"tag":82,"props":1728,"children":1730},{"className":1729},[],[1731],{"type":46,"value":322},{"type":46,"value":1733},". Use ",{"type":40,"tag":82,"props":1735,"children":1737},{"className":1736},[],[1738],{"type":46,"value":1739},"OnActivated",{"type":46,"value":1741}," for logic that must run on every foreground entry, not ",{"type":40,"tag":82,"props":1743,"children":1745},{"className":1744},[],[1746],{"type":46,"value":766},{"type":46,"value":1748},".",{"type":40,"tag":66,"props":1750,"children":1751},{},[1752,1757,1759,1764,1766,1771,1773,1779],{"type":40,"tag":192,"props":1753,"children":1754},{},[1755],{"type":46,"value":1756},"Deactivated ≠ Stopped.",{"type":46,"value":1758}," A dialog, split-screen, or notification pull-down triggers ",{"type":40,"tag":82,"props":1760,"children":1762},{"className":1761},[],[1763],{"type":46,"value":228},{"type":46,"value":1765}," without ",{"type":40,"tag":82,"props":1767,"children":1769},{"className":1768},[],[1770],{"type":46,"value":244},{"type":46,"value":1772},". Do not perform heavy saves in ",{"type":40,"tag":82,"props":1774,"children":1776},{"className":1775},[],[1777],{"type":46,"value":1778},"OnDeactivated",{"type":46,"value":1780}," — the app may never actually background.",{"type":40,"tag":66,"props":1782,"children":1783},{},[1784,1789,1791,1796,1798,1803,1805,1810,1811,1816],{"type":40,"tag":192,"props":1785,"children":1786},{},[1787],{"type":46,"value":1788},"Android back button skips Stopped.",{"type":46,"value":1790}," On Android, pressing back may call ",{"type":40,"tag":82,"props":1792,"children":1794},{"className":1793},[],[1795],{"type":46,"value":388},{"type":46,"value":1797}," directly without ",{"type":40,"tag":82,"props":1799,"children":1801},{"className":1800},[],[1802],{"type":46,"value":244},{"type":46,"value":1804},". Place critical save logic in both ",{"type":40,"tag":82,"props":1806,"children":1808},{"className":1807},[],[1809],{"type":46,"value":742},{"type":46,"value":1356},{"type":40,"tag":82,"props":1812,"children":1814},{"className":1813},[],[1815],{"type":46,"value":782},{"type":46,"value":1748},{"type":40,"tag":66,"props":1818,"children":1819},{},[1820,1825,1827,1832],{"type":40,"tag":192,"props":1821,"children":1822},{},[1823],{"type":46,"value":1824},"Multi-window apps fire events independently.",{"type":46,"value":1826}," On iPad, Mac Catalyst, and desktop Windows each ",{"type":40,"tag":82,"props":1828,"children":1830},{"className":1829},[],[1831],{"type":46,"value":595},{"type":46,"value":1833}," instance fires its own lifecycle events. Do not assume a single global lifecycle.",{"type":40,"tag":66,"props":1835,"children":1836},{},[1837,1842,1844,1849],{"type":40,"tag":192,"props":1838,"children":1839},{},[1840],{"type":46,"value":1841},"Long-running handlers cause kills.",{"type":46,"value":1843}," Android enforces a ~5 second ANR timeout; iOS has limited background execution time. Keep lifecycle handlers synchronous and fast — use ",{"type":40,"tag":82,"props":1845,"children":1847},{"className":1846},[],[1848],{"type":46,"value":750},{"type":46,"value":1850}," for quick saves, not database writes.",{"type":40,"tag":66,"props":1852,"children":1853},{},[1854,1859,1860,1866,1868,1874,1876,1882,1884,1889,1891,1896,1897,1902,1903,1908],{"type":40,"tag":192,"props":1855,"children":1856},{},[1857],{"type":46,"value":1858},"Do not use legacy Xamarin.Forms lifecycle methods.",{"type":46,"value":1333},{"type":40,"tag":82,"props":1861,"children":1863},{"className":1862},[],[1864],{"type":46,"value":1865},"Application.OnStart()",{"type":46,"value":1867},", ",{"type":40,"tag":82,"props":1869,"children":1871},{"className":1870},[],[1872],{"type":46,"value":1873},"Application.OnSleep()",{"type":46,"value":1875},", and ",{"type":40,"tag":82,"props":1877,"children":1879},{"className":1878},[],[1880],{"type":46,"value":1881},"Application.OnResume()",{"type":46,"value":1883}," exist for backward compatibility but bypass Window-level events. In .NET MAUI, prefer ",{"type":40,"tag":82,"props":1885,"children":1887},{"className":1886},[],[1888],{"type":46,"value":595},{"type":46,"value":1890}," lifecycle events (",{"type":40,"tag":82,"props":1892,"children":1894},{"className":1893},[],[1895],{"type":46,"value":1739},{"type":46,"value":1867},{"type":40,"tag":82,"props":1898,"children":1900},{"className":1899},[],[1901],{"type":46,"value":742},{"type":46,"value":1867},{"type":40,"tag":82,"props":1904,"children":1906},{"className":1905},[],[1907],{"type":46,"value":766},{"type":46,"value":1909},", etc.) for correct multi-window behavior.",{"type":40,"tag":1911,"props":1912,"children":1913},"style",{},[1914],{"type":46,"value":1915},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":1917,"total":2023},[1918,1935,1948,1966,1980,1999,2009],{"slug":1919,"name":1919,"fn":1920,"description":1921,"org":1922,"tags":1923,"stars":22,"repoUrl":23,"updatedAt":1934},"analyzing-dotnet-performance","analyze .NET code for performance anti-patterns","Scans .NET code for ~50 performance anti-patterns across async, memory, strings, collections, LINQ, regex, serialization, and I\u002FO with tiered severity classification. Use when analyzing .NET code for optimization opportunities, reviewing hot paths, or auditing allocation-heavy patterns.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1924,1925,1928,1931],{"name":17,"slug":18,"type":15},{"name":1926,"slug":1927,"type":15},"Code Analysis","code-analysis",{"name":1929,"slug":1930,"type":15},"Debugging","debugging",{"name":1932,"slug":1933,"type":15},"Performance","performance","2026-07-12T08:23:25.400375",{"slug":1936,"name":1936,"fn":1937,"description":1938,"org":1939,"tags":1940,"stars":22,"repoUrl":23,"updatedAt":1947},"android-tombstone-symbolication","symbolicate .NET runtime frames in Android tombstones","Symbolicate the .NET runtime frames in an Android tombstone file. Extracts BuildIds and PC offsets from the native backtrace, downloads debug symbols from the Microsoft symbol server, and runs llvm-symbolizer to produce function names with source file and line numbers. USE FOR triaging a .NET MAUI or Mono Android app crash from a tombstone, resolving native backtrace frames in libmonosgen-2.0.so or libcoreclr.so to .NET runtime source code, or investigating SIGABRT, SIGSEGV, or other native signals originating from the .NET runtime on Android. DO NOT USE FOR pure Java\u002FKotlin crashes, managed .NET exceptions that are already captured in logcat, or iOS crash logs. INVOKES Symbolicate-Tombstone.ps1 script, llvm-symbolizer, Microsoft symbol server.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1941,1942,1943,1944],{"name":17,"slug":18,"type":15},{"name":975,"slug":972,"type":15},{"name":1929,"slug":1930,"type":15},{"name":1945,"slug":1946,"type":15},"Microsoft","microsoft","2026-07-12T08:23:21.595572",{"slug":1949,"name":1949,"fn":1950,"description":1951,"org":1952,"tags":1953,"stars":22,"repoUrl":23,"updatedAt":1965},"apple-crash-symbolication","symbolicate .NET runtime frames in crash logs","Symbolicate .NET runtime frames in Apple platform .ips crash logs (iOS, tvOS, Mac Catalyst, macOS). Extracts UUIDs and addresses from the native backtrace, locates dSYM debug symbols, and runs atos to produce function names with source file and line numbers. Automatically downloads .dwarf symbols from the Microsoft symbol server using Mach-O UUIDs. USE FOR triaging a .NET MAUI or Mono app crash from an .ips file on any Apple platform, resolving native backtrace frames in libcoreclr or libmonosgen-2.0 to .NET runtime source code, retrieving .ips crash logs from a connected iOS device or iPhone, or investigating EXC_CRASH, EXC_BAD_ACCESS, SIGABRT, or SIGSEGV originating from the .NET runtime. DO NOT USE FOR pure Swift\u002FObjective-C crashes with no .NET components, or Android tombstone files. INVOKES Symbolicate-Crash.ps1 script, atos, dwarfdump, idevicecrashreport.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1954,1955,1956,1959,1962],{"name":17,"slug":18,"type":15},{"name":1929,"slug":1930,"type":15},{"name":1957,"slug":1958,"type":15},"iOS","ios",{"name":1960,"slug":1961,"type":15},"macOS","macos",{"name":1963,"slug":1964,"type":15},"Observability","observability","2026-07-12T08:23:20.369986",{"slug":1967,"name":1967,"fn":1968,"description":1969,"org":1970,"tags":1971,"stars":22,"repoUrl":23,"updatedAt":1979},"assertion-quality","evaluate assertion quality in test suites","Analyzes the variety and depth of assertions across test suites in any language. Use when the user asks to evaluate assertion quality, find shallow tests, identify assertion-free tests (no assertions or only trivial ones like Assert.IsNotNull \u002F toBeTruthy()), flag self-referential or tautological assertions, measure assertion diversity, or audit whether tests verify different facets of behavior. Polyglot: .NET, Python, TS\u002FJS, Java, Go, Ruby, Rust, Swift, Kotlin, PowerShell, C++. DO NOT USE FOR: writing new tests (use code-testing-agent \u002F writing-mstest-tests), mutation reasoning about whether tests would catch a bug (use test-gap-analysis), or a general severity-ranked anti-pattern audit (use test-anti-patterns), fixing or rewriting assertions, or writing, fixing, or modernizing MSTest tests, assertions, or attributes (use writing-mstest-tests).",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1972,1973,1976],{"name":1926,"slug":1927,"type":15},{"name":1974,"slug":1975,"type":15},"QA","qa",{"name":1977,"slug":1978,"type":15},"Testing","testing","2026-07-12T08:23:51.277743",{"slug":1981,"name":1981,"fn":1982,"description":1983,"org":1984,"tags":1985,"stars":22,"repoUrl":23,"updatedAt":1998},"author-component","create and review Blazor components","Create or review Blazor components (.razor files) with correct architecture. USE FOR: writing new Blazor components that do NOT involve JavaScript interop, implementing parameters and EventCallback, RenderFragment slots, component lifecycle (OnInitializedAsync, OnParametersSet), async patterns, IAsyncDisposable, CancellationToken, CSS isolation, code-behind. DO NOT USE FOR: creating new projects (use create-blazor-project), JavaScript interop or calling browser APIs from Blazor (use use-js-interop), forms and validation (use collect-user-input), prerendering issues (use support-prerendering), HTTP data fetching patterns (use fetch-and-send-data), coordinating state between unrelated components (use coordinate-components).\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1986,1987,1990,1992,1995],{"name":17,"slug":18,"type":15},{"name":1988,"slug":1989,"type":15},"Blazor","blazor",{"name":1991,"slug":427,"type":15},"C#",{"name":1993,"slug":1994,"type":15},"UI Components","ui-components",{"name":1996,"slug":1997,"type":15},"Web Development","web-development","2026-07-15T06:03:29.216359",{"slug":2000,"name":2000,"fn":2001,"description":2002,"org":2003,"tags":2004,"stars":22,"repoUrl":23,"updatedAt":2008},"binlog-failure-analysis","analyze MSBuild binary logs","Analyze MSBuild binary logs to diagnose build failures. USE FOR: build errors that are unclear from console output, diagnosing cascading failures across multi-project builds, tracing MSBuild target execution order, and generally any MSBuild build issues. Requires an existing .binlog file. DO NOT USE FOR: generating binlogs (use binlog-generation), non-MSBuild build systems.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2005,2006,2007],{"name":1926,"slug":1927,"type":15},{"name":1929,"slug":1930,"type":15},{"name":1945,"slug":1946,"type":15},"2026-07-12T08:21:34.637923",{"slug":2010,"name":2010,"fn":2011,"description":2012,"org":2013,"tags":2014,"stars":22,"repoUrl":23,"updatedAt":2022},"binlog-generation","generate MSBuild binary logs for diagnostics","Generate MSBuild binary logs (binlogs) for build diagnostics and analysis. USE FOR: adding \u002Fbl:{} to any dotnet build, test, pack, publish, or restore command to capture a full build execution trace, prerequisite for binlog-failure-analysis and build-perf-diagnostics skills, enabling post-build investigation of errors or performance. Requires MSBuild 17.8+ \u002F .NET 8 SDK+ for {} placeholder; PowerShell needs -bl:{{}}. DO NOT USE FOR: non-MSBuild build systems (npm, Maven, CMake), analyzing an existing binlog (use binlog-failure-analysis instead).",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2015,2018,2019],{"name":2016,"slug":2017,"type":15},"Build","build",{"name":1929,"slug":1930,"type":15},{"name":2020,"slug":2021,"type":15},"Engineering","engineering","2026-07-19T05:38:19.340791",96,{"items":2025,"total":2130},[2026,2038,2045,2052,2060,2066,2074,2080,2086,2096,2109,2120],{"slug":2027,"name":2027,"fn":2028,"description":2029,"org":2030,"tags":2031,"stars":2035,"repoUrl":2036,"updatedAt":2037},"multithreaded-task-migration","migrate MSBuild tasks to multithreaded mode","Guide for migrating MSBuild tasks to multithreaded mode support, including compatibility red-team review. Use this when converting tasks to thread-safe versions, implementing IMultiThreadableTask, adding TaskEnvironment support, or auditing migrations for behavioral compatibility.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2032,2033,2034],{"name":17,"slug":18,"type":15},{"name":2020,"slug":2021,"type":15},{"name":1932,"slug":1933,"type":15},5535,"https:\u002F\u002Fgithub.com\u002Fdotnet\u002Fmsbuild","2026-07-22T05:37:33.965588",{"slug":1919,"name":1919,"fn":1920,"description":1921,"org":2039,"tags":2040,"stars":22,"repoUrl":23,"updatedAt":1934},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2041,2042,2043,2044],{"name":17,"slug":18,"type":15},{"name":1926,"slug":1927,"type":15},{"name":1929,"slug":1930,"type":15},{"name":1932,"slug":1933,"type":15},{"slug":1936,"name":1936,"fn":1937,"description":1938,"org":2046,"tags":2047,"stars":22,"repoUrl":23,"updatedAt":1947},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2048,2049,2050,2051],{"name":17,"slug":18,"type":15},{"name":975,"slug":972,"type":15},{"name":1929,"slug":1930,"type":15},{"name":1945,"slug":1946,"type":15},{"slug":1949,"name":1949,"fn":1950,"description":1951,"org":2053,"tags":2054,"stars":22,"repoUrl":23,"updatedAt":1965},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2055,2056,2057,2058,2059],{"name":17,"slug":18,"type":15},{"name":1929,"slug":1930,"type":15},{"name":1957,"slug":1958,"type":15},{"name":1960,"slug":1961,"type":15},{"name":1963,"slug":1964,"type":15},{"slug":1967,"name":1967,"fn":1968,"description":1969,"org":2061,"tags":2062,"stars":22,"repoUrl":23,"updatedAt":1979},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2063,2064,2065],{"name":1926,"slug":1927,"type":15},{"name":1974,"slug":1975,"type":15},{"name":1977,"slug":1978,"type":15},{"slug":1981,"name":1981,"fn":1982,"description":1983,"org":2067,"tags":2068,"stars":22,"repoUrl":23,"updatedAt":1998},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2069,2070,2071,2072,2073],{"name":17,"slug":18,"type":15},{"name":1988,"slug":1989,"type":15},{"name":1991,"slug":427,"type":15},{"name":1993,"slug":1994,"type":15},{"name":1996,"slug":1997,"type":15},{"slug":2000,"name":2000,"fn":2001,"description":2002,"org":2075,"tags":2076,"stars":22,"repoUrl":23,"updatedAt":2008},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2077,2078,2079],{"name":1926,"slug":1927,"type":15},{"name":1929,"slug":1930,"type":15},{"name":1945,"slug":1946,"type":15},{"slug":2010,"name":2010,"fn":2011,"description":2012,"org":2081,"tags":2082,"stars":22,"repoUrl":23,"updatedAt":2022},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2083,2084,2085],{"name":2016,"slug":2017,"type":15},{"name":1929,"slug":1930,"type":15},{"name":2020,"slug":2021,"type":15},{"slug":2087,"name":2087,"fn":2088,"description":2089,"org":2090,"tags":2091,"stars":22,"repoUrl":23,"updatedAt":2095},"build-parallelism","optimize MSBuild build parallelism","Diagnose and fix under-parallelized MSBuild builds. USE WHEN a multi-project solution build is slower than expected, doesn't speed up when you add cores, pegs a single core while others idle, or you want to know why `-m` isn't helping. Note: `\u002Fmaxcpucount` default is 1 (sequential) — always pass `-m` for parallel builds. Covers finding the critical path (longest serial ProjectReference chain), graph build (`\u002Fgraph`), BuildInParallel, and solution filters (`.slnf`). DO NOT USE FOR: single-project builds, incremental issues (use incremental-build), compilation slowness inside one project (use build-perf-diagnostics), non-MSBuild build systems.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2092,2093,2094],{"name":17,"slug":18,"type":15},{"name":2020,"slug":2021,"type":15},{"name":1932,"slug":1933,"type":15},"2026-07-19T05:38:18.364937",{"slug":2097,"name":2097,"fn":2098,"description":2099,"org":2100,"tags":2101,"stars":22,"repoUrl":23,"updatedAt":2108},"build-perf-baseline","establish and optimize build performance baselines","Establish build performance baselines and apply systematic optimization techniques. USE FOR: diagnosing slow builds, establishing before\u002Fafter measurements (cold, warm, no-op scenarios), applying optimization strategies like MSBuild Server, static graph builds, artifacts output, and dependency graph trimming. Start here before diving into build-perf-diagnostics, incremental-build, or build-parallelism. DO NOT USE FOR: non-MSBuild build systems, detailed bottleneck analysis (use build-perf-diagnostics after baselining).",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2102,2103,2106,2107],{"name":2020,"slug":2021,"type":15},{"name":2104,"slug":2105,"type":15},"Monitoring","monitoring",{"name":1932,"slug":1933,"type":15},{"name":1977,"slug":1978,"type":15},"2026-07-12T08:21:35.865649",{"slug":2110,"name":2110,"fn":2111,"description":2112,"org":2113,"tags":2114,"stars":22,"repoUrl":23,"updatedAt":2119},"build-perf-diagnostics","diagnose MSBuild build performance bottlenecks","Diagnose MSBuild build performance bottlenecks using binary log analysis. USE FOR: identifying why builds are slow by analyzing binlog performance summaries, detecting ResolveAssemblyReference (RAR) taking >5s, Roslyn analyzers consuming >30% of Csc time, single targets dominating >50% of build time, node utilization below 80%, excessive Copy tasks, NuGet restore running every build. Covers timeline analysis, Target\u002FTask Performance Summary interpretation, and 7 common bottleneck categories. Use after build-perf-baseline has established measurements. DO NOT USE FOR: establishing initial baselines (use build-perf-baseline first), fixing incremental build issues (use incremental-build), parallelism tuning (use build-parallelism), non-MSBuild build systems.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2115,2116,2117,2118],{"name":17,"slug":18,"type":15},{"name":1929,"slug":1930,"type":15},{"name":2020,"slug":2021,"type":15},{"name":1932,"slug":1933,"type":15},"2026-07-12T08:21:40.961722",{"slug":2121,"name":2121,"fn":2122,"description":2123,"org":2124,"tags":2125,"stars":22,"repoUrl":23,"updatedAt":2129},"check-bin-obj-clash","detect MSBuild output path conflicts","Detects MSBuild projects with conflicting OutputPath or IntermediateOutputPath. USE FOR: builds failing with 'Cannot create a file when that file already exists', 'The process cannot access the file because it is being used by another process', intermittent build failures that succeed on retry, or missing\u002Foverwritten outputs in multi-project or multi-targeting builds where bin\u002Fobj (or project.assets.json) collide. Common causes: shared OutputPath, missing AppendTargetFrameworkToOutputPath, extra global properties (e.g. PublishReadyToRun), or SetTargetFramework on a ProjectReference to a single-targeting project. DO NOT USE FOR: file access errors unrelated to MSBuild (OS-level locking), single-project single-TFM builds, non-MSBuild build systems.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2126,2127,2128],{"name":1929,"slug":1930,"type":15},{"name":2020,"slug":2021,"type":15},{"name":1974,"slug":1975,"type":15},"2026-07-19T05:38:14.336279",144]