maui
maui copied to clipboard
Styles from Resources are not Cascading to when Style is also set in Xaml file
Description
For example When setting a style trough the resource dictionary tag on a xaml page for all buttons even if you set CanCascade=True it won't work, and only the styles applied in this file will work and you'll lose all outside styling.
Steps to Reproduce
- This problem is only with .Net8, not with .Net7, so make sure to use .Net8
- Make a Maui Project
- Make a Xaml page
- Add a Button
- Go outside of this file (to the Recourses>Styles) and make a style to target buttons and set the background blue, and make sure it works
- Go back to your Xaml file make a style and target buttons (ContentPage.Resources>ResourceDictionary>Style tag) and set the border to red and set
CanCascade=True, so the background color should still be blue - Now you'll find that in the case where you Set Styles in the xaml file it self, it will never take styles from above it, CanCascade will always be false, CanCascade=True does not work
Link to public reproduction project repository
No response
Version with bug
8.0.3 GA
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
7.0.101
Affected platforms
iOS, Android, Windows, macOS
Affected platform versions
No response
Did you find any workaround?
Yea, i use .Net 7. 😢
Relevant log output
No response
cc @StephaneDelcroix
We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.
Any updates?