Skip to content

Public API Requirements : ThemeManager, ThemeMode ?? #8540

Open

Description

@singhashish-wpf

Description

There are a few public API changes related to theme management for Fluent theme that may be needed in the future, but we are not set on what those APIs should be to make it feature complete.

Currently we have experimental ThemeMode APIs for Application and Window which are only Fluent specific and do not function for other themes. This needs to be changed and we need to find a better way to deal with theme and theme variants.

Previously there has been a lot of discussion on this topic on the following threads :

WPF.UI has the following APIs :

  • ThemeService
  • ApplicationThemeManager
  • SystemThemeManager
  • SystemThemeWatcher
  • ApplicationTheme
  • SystemTheme
  • ThemeChangedEvent
  • IThemeService

WPF may need some or most of these APIs, but that can be discussed only after we finalize the approach on how we are going to use Fluent as default theme.

Activity

  1. converted this from a draft issue on Dec 14, 2023
  2. added
    User Story
    on Mar 21, 2024
  3. changed the title [-]Public API Changes[/-] [+]ThemeManager, ThemeMode APIs[/+] on Feb 3, 2025
  4. changed the title [-]ThemeManager, ThemeMode APIs[/-] [+]Public API Requirements : ThemeManager, ThemeMode ??[/+] on Feb 3, 2025
  5. added this to the milestone on Feb 3, 2025
  6. modified the milestones: , 10.0.0 on Apr 9, 2025
  7. nzain commented on Nov 22, 2025

    @nzain

    When experimenting on net10 with FluentTheme I came to a point where I needed some way to

    • get notified on theme changes (when ThemeMode.System follows system settings)
    • convert ThemeMode.System to either light or dark for custom code behind

    This is because some parts of our UI are not WPF (OpenGL rendering and OxyPlot) and I'd like to style those parts according to the application theme. Personally I love dark themes and use them everywhere - and I feel terrible because my own apps don't support it, yet :-)

    It looks like ThemeManager.cs has some registry magic to do the latter. I didn't dig deep enough to find something for the first problem (quick google returned only terrible ideas). Keep up the good work on FluentTheme!

  8. miloush commented on Nov 22, 2025

    @miloush
    Contributor

    As for theme change notifications, you can subscribe to SystemEvents.UserPreferenceChanged

  9. Veritera commented on Apr 23, 2026

    @Veritera

    I honestly don't see the necessity for mirroring the complexity of WPF.UI (e.g., SystemThemeManager, SystemThemeWatcher, and multiple ThemeMode types). While WPF.UI is a great library, its approach to theme management is arguably over-engineered for a native integration into the WPF framework.

    Why maintain two different ThemeManagers and two different ThemeModes when, in the end, it always boils down to two binary signals?

    AppsUseLightTheme (from the Registry)

    SystemParameters.HighContrast

    To break down why the "System Theme" part of the current proposal is redundant:

    • Light/Dark: Both system and apps follow the global toggle.

    • Custom: Windows allows users to set the system mode to light while keeping the app mode dark. A WPF application should strictly follow the app mode.

    • High Contrast: This is already reliably handled by existing system parameters.

    We should simplify the native API:
    The application only needs to know if it should render in Light, Dark, or HC mode based on the user's app-specific preference.

    But maybe i missed some important details and there is actually a good reason for it.
    In that case, please enlighten me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    User StoryWin 11 Theming

    Type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions