maui icon indicating copy to clipboard operation
maui copied to clipboard

Styles from Resources are not Cascading to when Style is also set in Xaml file

Open jacobglanz opened this issue 1 year ago • 5 comments

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

  1. This problem is only with .Net8, not with .Net7, so make sure to use .Net8
  2. Make a Maui Project
  3. Make a Xaml page
  4. Add a Button
  5. 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
  6. 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
  7. 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

jacobglanz avatar Feb 18 '24 19:02 jacobglanz

cc @StephaneDelcroix

jsuarezruiz avatar Feb 19 '24 15:02 jsuarezruiz

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.

ghost avatar Feb 19 '24 15:02 ghost

Any updates?

jacobglanz avatar Jun 03 '24 05:06 jacobglanz