-
Notifications
You must be signed in to change notification settings - Fork 49
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
Using static styles in templated control works incorrectly #2399
Comments
C# Markup wasn't setting TargetType correctly, this is fixed in 5.4.0-dev.27. Once a package is released, I'll re-test the behavior on WinUI, and also check the other issues. |
For the wrong style issue, the remaining issue is also a C# Markup bug which we will track. As a workaround, create extra empty classes: public partial class FrameA : Frame { }
public partial class FrameB : Frame { } And use them in the template of the styles. So, instead of And yes, I know it doesn't make any sense that my suggestion can have an impact on behavior, but it does due to some implementation details of C# Markup. Alternative workaround: In only one of the templates, cast the |
Re-opening to validate the recent fixes and investigate more |
This is now fixed in C# Markup 5.4.0-dev.30. |
I tested it with the newest branch |
@kucint Can you verify you are not overriding If you have |
you are right, I forgot that this section is no longer necessary starting from "Uno.Sdk": "5.4.0"
My bad, sorry! |
Discussed in #2349
Originally posted by kucint June 13, 2024
This issue is a continuation of #2316.
Repro steps:
Create a simple control with two predefined static styles:
MyStyleA
andMyStyleB
Assign
MyStyleA
to your control's style.Issue 1:
this issue can be observed on windows:
TargetFramework:
net8.0-desktop;
Expected behavior:
MyStyleA
is used,Actual behavior:
MyStyleB
is used,Issue 2:
this issue can be observed on windows:
TargetFramework:
net8.0-windows10.0.19041
Application is unstable:
One of following may happen:
MyControl
is not presented, terminates with error code = 0MyControl
is not presented, terminates with error code = 0xc0000374See #2311 for similar behavior
"Uno.Sdk": "5.2.161"
repro: UnoChangingControlStyleApp.zip
The text was updated successfully, but these errors were encountered: