Framework Cross-Platform UI v0.1.0

.NET MAUI Theming

Guide for theming .NET MAUI apps — light/dark mode via AppThemeBinding, ResourceDictionary theme switching, DynamicResource bindings, system theme detection, and user theme preferences. Use when: "dark mode", "light mode", "theming", "AppThemeBinding", "theme switching", "ResourceDictionary theme", "dynamic resources", "system theme detection", "color scheme", "app theme", "DynamicResource". Do not use for: localization or language switching (see .NET MAUI localization documentation), accessibility visual adjustments (see .NET MAUI accessibility documentation), app icons or splash screens (see .NET MAUI app icons documentation), or Bootstrap-style class theming (see Plugin.Maui.BootstrapTheme NuGet package).

Workflow

  1. Detect the current theme approach in the project (AppThemeBinding, ResourceDictionary, or none).
  2. Choose the appropriate strategy: AppThemeBinding for simple light/dark, ResourceDictionary swap for custom/multiple themes, or both combined.
  3. Define theme resources — inline AppThemeBinding values or separate ResourceDictionary files with matching keys.
  4. Replace hardcoded colors with DynamicResource bindings (or AppThemeBinding markup) throughout XAML pages.
  5. Add system theme detection via Application.Current.RequestedTheme and the RequestedThemeChanged event.
  6. Implement user preference persistence with Preferences.Set / Preferences.Get and apply on startup.
  7. Verify Android ConfigChanges.UiMode is set on MainActivity to avoid activity restarts on theme change.
  8. Test both light and dark themes on at least one target platform, confirming all UI elements respond correctly.

Related skills

Build, review, or migrate .NET MAUI applications across Android, iOS, macOS, and Windows with correct cross-platform UI, platform integration, and native packaging assumptions.

Microsoft.Maui.*

.NET MAUI app lifecycle guidance — the four app states, cross-platform Window lifecycle events (Created, Activated, Deactivated, Stopped, Resumed, Destroying), platform-specific…

Microsoft.Maui.*