Theming is managed by five core components that coordinate to update the UI:
- ApplicationThemeManager: Handles high-level theme selection (e.g., Light vs Dark).
- ApplicationAccentColorManager: Manages accent colors used throughout the UI.
- SystemThemeWatcher: Monitors OS-level theme changes to keep the app in sync.
- WindowBackgroundManager: Manages the appearance of window backgrounds.
- ResourceDictionaryManager: Performs the actual swapping of XAML
ResourceDictionary objects.
Theme Change Flow:
User $\rightarrow$ OS Settings $\rightarrow$ WndProc $\rightarrow$ SystemThemeWatcher $\rightarrow$ ApplicationThemeManager $\rightarrow$ ResourceDictionaryManager $\rightarrow$ Application.Resources $\rightarrow$ UI Update.