Open
Description
Proposal: Non-XAML ThemeResource
Summary
Currently it is only possible to set ThemeResource
from XAML, which is problematic in various scenarios, for example in Uno Platform's C# Markup:
- [MVUX/CSM] Resources don't update after changing Fluent Theme manually unoplatform/uno.extensions#2429
- https://github.com/unoplatform/uno.csharpmarkup/issues/716
This is especially problemtai
Rationale
- It is not possible to retrieve a theme-dependent brush for a given theme from a
ResourceDictionary
in code - It is not possible to set a property like
Background
orBorderBrush
of a control to a theme-dependent brush in code
Scope
Capability | Priority |
---|---|
Retrieve a theme-dependent value of a resource from ResourceDictionary in code |
Must |
Set a control's dependency property to a theme-dependent resource in code | Must |
Workarounds
There some very limited ways to work around this, like:
microsoft-ui-xaml/src/controls/dev/WebView2/WebView2.cpp
Lines 909 to 927 in 66a7b0a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment