Open ArchieCoder opened 3 months ago
cc @kazo0
@ArchieCoder if you add the BasedOn="{StaticResource DefaultButtonStyle}"
then it should At least for the net8.0-desktop target, I will try with windows as well
Adding BasedOn="{StaticResource DefaultButtonStyle}" works for net8.0, but it does not work for WinUI.
ArgumentException: Value does not fall within the expected range.
call-stack:
00 UnoApp1.Presentation.MainPage.MainPage() Line 7
01 UnoApp1.Presentation.MainPage.InitializeComponent() Line 41
02 Microsoft.UI.Xaml.Application.LoadComponent(object component, System.Uri resourceLocator, Microsoft.UI.Xaml.Controls.Primitives.ComponentResourceLocation componentResourceLocation) Line 324
03 ABI.Microsoft.UI.Xaml.IApplicationStaticsMethods.LoadComponent(WinRT.IObjectReference _obj, object component, System.Uri resourceLocator, Microsoft.UI.Xaml.Controls.Primitives.ComponentResourceLocation componentResourceLocation) Line 13782
04 [Managed to Native Transition]
05 [Native to Managed Transition]
06 ABI.Microsoft.UI.Xaml.PropertyChangedCallback.Do_Abi_Invoke(nint thisPtr, nint d, nint e) Line 26020
07 Uno.Toolkit.UI.ResourceExtensions.OnResourcesChanged(Microsoft.UI.Xaml.DependencyObject d, Microsoft.UI.Xaml.DependencyPropertyChangedEventArgs e) Line 34
08 Microsoft.UI.Xaml.FrameworkElement.Resources.set(Microsoft.UI.Xaml.ResourceDictionary value) Line 4337
09 ABI.Microsoft.UI.Xaml.IFrameworkElementMethods.set_Resources(WinRT.IObjectReference _obj, Microsoft.UI.Xaml.ResourceDictionary value) Line 17611
10 WinRT.ExceptionHelpers.ThrowExceptionForHR(int hr) Line 148
11 WinRT.ExceptionHelpers.ThrowExceptionForHR.__Throw|39_0(int hr) Line 146
this can be repro'd with:
var rd = new ResourceDictionary();
Border1.Resources = rd;
Border2.Resources = rd;
which is exactly what we are doing here.
@Xiaoy312 Thanks for the fast follow-up. Is this fix going to be in the next official release 5.3 only?
I don't know mergify. I see backport, but I'm not sure what it means.
I will let @agneszitte answer you.
@ArchieCoder yep this will be in the next stable packages of Toolkit that will be part of the overall Uno 5.3 release
@Xiaoy312 I cannot repro the issue with the original app in this issue, but with my app, the bug still reside.
Here is a stripped-down version of my app. Test.zip
@Xiaoy312 I cannot repro the issue with the original app in this issue, but with my app, the bug still reside.
Here is a stripped-down version of my app. Test.zip
@Xiaoy312 can you take a look at the new sample that @ArchieCoder provided, please (that uses Uno.Sdk 5.3.31 that normally includes the fixes for your previous PR https://github.com/unoplatform/uno.toolkit.ui/pull/1190). Thanks in advance.
@Xiaoy312 I cannot repro the issue with the original app in this issue, but with my app, the bug still reside. Here is a stripped-down version of my app. Test.zip
@Xiaoy312 can you take a look at the new sample that @ArchieCoder provided, please (that uses Uno.Sdk 5.3.31 that normally includes the fixes for your previous PR #1190). Thanks in advance.
@Kunal22shah I will let you take a look as @Xiaoy312 is busy with other tasks please
@Xiaoy312 I cannot repro the issue with the original app in this issue, but with my app, the bug still reside.
Here is a stripped-down version of my app. Test.zip
Thanks @ArchieCoder for providing the zip file. I tested it with the latest 5.3.99
Uno SDK and it seem to work as expected, can you please confirm :
@Kunal22shah Did you try with Skia Desktop? With 5.3.99 and 5.4.0-dev.220, in Skia the buttons are gray not blue.
@ArchieCoder i ran the desktop WSL, it good for 5.3.99:
@Kunal22shah I added more style files from my project and I'm able to repro the issue.
Here is the new sample app: App1Updated.zip
@Kunal22shah I added more style files from my project and I'm able to repro the issue.
Here is the new sample app: App1Updated.zip
Thank you a lot @ArchieCoder for the sample, @Kunal22shah will be able to investigate.
@ArchieCoder Thanks again, can you double check the app you shared, I don't see the buttons on WSL now: vs desktop:
@Kunal22shah In WSL, I do not see the buttons as well. If you remove "Style="{StaticResource ActionButtonStyle}", you will see the buttons. The bug seems then worse in Linux. This is just a page with 2 buttons.
@ArchieCoder So upon investigation, it seems like its a uno bug and i have created this issue for the samehttps://github.com/unoplatform/uno/issues/18132. For now i would suggest the follow workaround to you:
For WinAppSDK : using latest toolkit version will fix it - <UnoToolkitVersion>6.2.0-dev.41</UnoToolkitVersion>
For WSL : you will need to add BasedOn="{StaticResource DefaultButtonStyle}"
to the button style in the Page resources on the MainPage.
@Kunal22shah for the time being I will use the old style (that's the best workaround), but let me know when the bug will be resolved and I will test it. Thanks.
Current behavior
Expected behavior
Same blue background for both buttons
How to reproduce it (as minimally and precisely as possible)
UnoApp1.zip
The only difference is I don't use BasedOn in my Style
Workaround
No response
Works on UWP/WinUI
No
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