unoplatform / uno

Build Mobile, Desktop and WebAssembly apps with C# and XAML. Today. Open source and professionally supported.
https://platform.uno
Apache License 2.0
8.77k stars 706 forks source link

Styles Not Applying When Overriding in Page Resources #18132

Open Kunal22shah opened 1 week ago

Kunal22shah commented 1 week ago

Current behavior

When overriding button styles in the main page resources using the same key as the global resource, the styles do not apply on WSL (Desktop), but they do on Windows (with latest toolkit : <UnoToolkitVersion>6.2.0-dev.41</UnoToolkitVersion> ). A workaround involves adding BasedOn="{StaticResource DefaultButtonStyle}" to the button style, which makes it work on WSL as well. Repro : UnoApp5.zip (no blue background for the buttons)

RE-bug

Expected behavior

Same blue background for both buttons

How to reproduce it (as minimally and precisely as possible)

No response

Workaround

adding BasedOn="{StaticResource DefaultButtonStyle}" to the button style in the Page Resources

Works on UWP/WinUI

None

Environment

No response

NuGet package version(s)

No response

Affected platforms

No response

IDE

No response

IDE version

No response

Relevant plugins

No response

Anything else we need to know?

No response

agneszitte commented 1 week ago

cc @MartinZikmund, @kazo0 for info Related Toolkit issue: https://github.com/unoplatform/uno.toolkit.ui/issues/1187

kazo0 commented 1 week ago

I don't think this is necessarily constrained to WSL. I can repro on net8.0-desktop windows

kazo0 commented 1 week ago

Probably related? https://github.com/unoplatform/uno/issues/18115