What problem does it solve?
It solves the problem of building a .NET MAUI app UI that correctly adapts to light/dark mode (including system-driven changes and user preferences) without hardcoded colors that break theme switching.
Core Features & Use Cases
- AppThemeBinding for OS light/dark: Apply light and dark values directly in XAML for consistent automatic theme behavior.
- ResourceDictionary swapping for custom themes: Create branded light/dark (or multiple) themes using matching resource keys and swap them at runtime.
- System theme detection and runtime reaction: Read
Application.Current.RequestedTheme, subscribe to RequestedThemeChanged, and update UI/dictionaries accordingly.
- Persisted user theme preference: Save the user’s choice via
Preferences and apply it on startup.
- DynamicResource correctness: Ensure theme-swapped resources update live by using
DynamicResource instead of StaticResource.
Quick Start
Tell the AI: "Help me add light/dark support to my .NET MAUI app using AppThemeBinding and DynamicResource, detect system theme changes, and persist the user’s preferred theme with Preferences."