What problem does it solve?
This Skill helps you configure dependency injection in .NET MAUI so your Pages and ViewModels reliably receive the services they depend on, with correct lifetimes and predictable Shell navigation behavior.
Core Features & Use Cases
- Correct DI setup in MauiProgram.cs: Register shared services and UI types using appropriate lifetimes for MAUI.
- Reliable constructor injection: Ensure Pages and ViewModels get dependencies injected and avoid silent nulls caused by missing registrations.
- Shell navigation auto-resolution: Enable Shell route navigation to resolve the full dependency graph for routed Pages.
- Platform-specific registrations: Use conditional compilation to register the right implementations per target platform with safe fallbacks.
- Testability via interface-first design: Swap implementations in tests without changing production wiring.
Quick Start
Ask the AI to generate a MauiProgram.cs service registration plan and a Page/ViewModel wiring approach for your MAUI app, including which items should be Singleton vs Transient and how to ensure Shell navigation resolves everything.