-
This issue is a continuation of #2316. Repro steps: Issue 1: this issue can be observed on windows: Expected behavior: internal sealed class MyControl : Control
{
public static readonly Style<MyControl> _styleA = new MyStyleA(); // red
public static readonly Style<MyControl> _styleB = new MyStyleB(); // blue
public MyControl()
{
DefaultStyleKey = typeof(MyControl);
Style = _styleA; // uses style B: error, expected style A
//Style = _styleB; // uses style B
//Style = new MyStyleA(); // uses style A
//Style = new MyStyleB(); // uses style B
}
}
internal class MyStyleA : Style<MyControl>
{
public MyStyleA() => Setters(s => s
.Template(ctrl =>
new Frame()
.Background(Colors.LightCoral)
));
}
internal class MyStyleB : Style<MyControl>
{
public MyStyleB() => Setters(s => s
.Template(ctrl =>
new Frame()
.Background(Colors.LightSkyBlue)
));
}
public sealed partial class MainPage : Page
{
public MainPage()
{
this
.Background(ThemeResource.Get<Brush>("ApplicationPageBackgroundThemeBrush"))
.Content(new StackPanel()
.VerticalAlignment(VerticalAlignment.Center)
.HorizontalAlignment(HorizontalAlignment.Center)
.Children(
new TextBlock()
.Text("Hello Uno Platform!"),
new MyControl()
.Width(200)
.Height(200)
));
}
} Issue 2: this issue can be observed on windows: Application is unstable:
See #2311 for similar behavior
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
For the issue 1, I'm able to repro. I would suspect that we are registering both For issue 2, what I'm able to repro:
Definitely looks like a concurrency issue ... Transferring to @dansiegel as master of C# markup |
Beta Was this translation helpful? Give feedback.
-
Hi @dansiegel, the #2405 is already merged so I downloaded the newest uno sdk and tested it again. |
Beta Was this translation helpful? Give feedback.
this has been clarified in #2399, all is OK.