-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Implicit styling on .NET 8 is being ignored on the page level #19820
Comments
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. |
It looks like Styles set over VisualStateGroups on Applicationlevel still work on Page Level when used in an implicit Style (no x:Key set, just TargetType). |
I've been looking for a work around for nearly all of my global styles breaking when I moved to .net 8.0 and I used your work around to fix my issue so thank you. It appears that when you specify a visual state setter globally and then specify some property at the page level for any control, it overrides the global style unless its inside of the normal state. |
I really wonder why there are no other developers experiencing this issue. I couldn't find any other evidence that this problem exists for other people. So, I wonder what I am doing wrong. |
I've been looking around and I also can't seem to find any other instance of this happening. I've converted all of my styles to set properties inside of the normal visual state which seems to fix the issue for me. So long as I overwrite the styles in the normal visual state in the content page, it still accepts the global style. |
Verified this on Visual Studio Enterprise 17.10.0 Preview 1(8.0.6). Repro on Windows 11, Android 14.0-API34, iOS 17.2 and MacCatalyst with below Project: |
It's too scary, I have to add a lot of code |
Description
The implicit styling set on the page level does not utilize implicit styling on the application level.
Example:
There is a styling with TargetType="Label" on the application level that sets the TextColor to Red and the background color to Yellow.
There is a Label on the MainPage with no inline styling set.
However, on the page level, there exists a styling with TargetType="Label" and a Setter for the TextColor set to Green.
The expected behavior is that the Label has a Green TextColor and a Yellow BackgroundColor.
The behavior on .NET 7 and .NET 8 is different.
It works on .NET 7 but not on .NET 8.
On .NET 8, all stylings from the application level are being ignored.
.Net 7
![Screenshot_20240111_110339](https://private-user-images.githubusercontent.com/6299519/295872439-6379ef3f-77b4-4ed0-804e-1e1211aa49c0.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3Lm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NTNQUUs0WkElMkYyMDI0MDcxMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MTBUMDExNzI2WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YzhlYjkwNmI5MGU1MGMxMmRkMGJlMzI2NzNjZjMwZmQwZmMyODVjZDhjMmViOWVlZmEyYTY2ODFkMDc3ZDdkOCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.uepN9xs08K9Yd4OPtN0EUJcQmwB6E1X_qEJkRT73DnA)
Steps to Reproduce
No response
Link to public reproduction project repository
https://github.com/BFuchshofer/StyleTest
Version with bug
8.0.5
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI, Yes, this used to work in Xamarin.Forms
Last version that worked well
7.0.101
Affected platforms
iOS, Android
Affected platform versions
No response
Did you find any workaround?
No response
Relevant log output
No response
The text was updated successfully, but these errors were encountered: