Skip to content

Element-level Theme #3302

Closed

Description

@MartinZikmund

What would you like to be added:

Support for:

  • FrameworkElement.RequestedTheme
  • FrameworkElement.ActualTheme
  • FrameworkElement.ActualThemeChanged

In case of WASM, we should ideally also apply color-scheme based on the actual theme of each element

Also see the comments below for further requirements!

Why is this needed:

For full theming fidelity.

Activity

  1. added
    kind/enhancement
    triage/untriaged
    on Jun 4, 2020
  2. self-assigned this
    on Jun 4, 2020
  3. added
    platform/android 🤖
    platform/ios 🍎
    platform/macos 🍏
    platform/wasm 🌐
    and removed
    triage/untriaged
    on Jun 4, 2020
  4. modified the milestone: 3.1 on Aug 29, 2020
  5. added
    project/styling 👔
    and removed on Sep 21, 2020
  6. added this to the 3.6 milestone on Jan 30, 2021
  7. removed this from the 3.6 milestone on Feb 11, 2021
  8. 6 remaining items

  9. removed this from the 3.8 milestone on Apr 20, 2021
  10. added this to the 3.9 milestone on Jun 1, 2021
  11. removed this from the 3.9 milestone on Jul 26, 2021
  12. MartinZikmund commented on Aug 1, 2021

    @MartinZikmund
    MemberAuthor

    When this is implemented, the related Uno-specific TODO in BackdropMaterial.cs needs to be removed (and replaced with the original WinUI implementation)

  13. MartinZikmund commented on Aug 5, 2021

    @MartinZikmund
    MemberAuthor

    While initial support for ActualTheme and ActualThemeChanged is added in #6655, it will need further improvements when this is implemented. Specifically consider the following scenario:

    1. OS theme is set to light and App does not explicitly set RequestedTheme
    2. On MainPage.Loaded a Border is created. Its ActualTheme should match application theme
    3. We store the border instance in a field like _border, but do not add it to the visual tree.
    4. We set root element's RequestedTheme to Dark
    5. Now the _border should still have ActualTheme of Light!
    6. Only when the _border is added to the visual tree, its ActualTheme will switch to Dark and ActualThemeChanged is triggered.

    However - the following scenario should work as well:

    1. OS theme is set to light and App does not explicitly set RequestedTheme
    2. On MainPage.Loaded a Border is created. Its ActualTheme should match application theme
    3. We store the border instance in a field like _border, but do not add it to the visual tree.
    4. We switch the OS theme to Dark
    5. No ActualThemeChanged event is triggered automatically.
    6. When ActualTheme is queried, ActualThemeChanged is triggered, and the new theme is Dark

    ActualThemeChanged event is triggered on theme change automatically only for elements which are part of the visual tree, others trigger it only when explicitly queried.

  14. MartinZikmund commented on Apr 14, 2023

    @MartinZikmund
    MemberAuthor

    The changes in #11983 have introduced DefaultTextForegroundThemeBrush support, which also needs to adhere to the element-level theme!

  15. MartinZikmund commented on Jan 30, 2024

    @MartinZikmund
    MemberAuthor

    When supported, native date and time pickers should follow the picker's actual theme instead of the application one
    See PRs for

  16. mcNets commented on Jul 15, 2024

    @mcNets
    Contributor

    @MartinZikmund you should consider Desktop apps too, it isn't in the platforms list.

  17. MartinZikmund commented on Jan 31, 2025

    @MartinZikmund
    MemberAuthor

    The initial attempt for this is in #3387, but needs to be reworked on latest master, as there have been significant changes

  18. added theissue type on Jul 25, 2025
  19. changed the issue type fromtoon Jul 25, 2025
  20. github-actions commented on Apr 30, 2026

    @github-actions
    Contributor

    This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs or feature requests.

  21. locked as resolved and limited conversation to collaborators on Apr 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

difficulty/challenging 🤯kind/enhancementplatform/android 🤖platform/ios 🍎platform/macos 🍏platform/wasm 🌐project/styling 👔

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions