-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Control with Win11 theming falls back to "old" theming when applying a style #10054
Comments
@Zagrthos, you are right. Since, you mentioned you are new, I will dig a little deep into this here. All the FrameworkElements have two properties : Fluent theme styles require more flexibility in terms of customizability and resource usage as compared to other themes, and so in the current system, the Fluent styles are loaded in the Style property. Whereas, Aero2 is still being loaded in the ThemeStyle property. Now, when you provided your own style, the Fluent style got replaced and your style is being loaded in the FrameworkElement's Style property, and since only some of the properties are defined in the custom style rest of them are being picked from ThemeStyle ( i.e. Aero2 ) style. We will work on a fix for this. |
@dipeshmsft thanks for your kind explanation and the reply! I'm still trying to fiddle with WPF, tried it a few times already but XAML and MVVM scared me off a lot. Hopefully that'll work out now 😀 |
I am not quite sure how this is expected to be fixed, there will always be "unexpected' ways people accidentally remove it. That's why there is ThemeStyle and why the Fluent theme needs to be loaded the same way. And you didn't run into the precedence issues yet. EDIT: I might have read this too fast, this looks like a precedence issue. |
As a workaround, you can set BasedOn property of the Style to |
@aquinn39 is right, initially I wrote that in my comment, but then it was pointed out by @harshit7962, that we missed giving a Key to TabItem style and then I removed that. |
Description
When applying a custom style to a control which is themed via the Windows 11 MergedDictionary it falls back to the old theming.
Reproduction Steps
Create a new WPF Window and add a TabControl with TabItems to it. Then apply the following style to the window:
Expected behavior
The style is just added without removing the theming.
Actual behavior
Fallback to old theming
Regression?
No response
Known Workarounds
No response
Impact
No response
Configuration
Other information
Maybe I am too new to WPF and that's expected, because it's wanted by design, but for me right now it's appears like a (possible) bug.
The text was updated successfully, but these errors were encountered: