Open FrozDark opened 1 year ago
Thanks for the report. This is looks like a duplicate of https://github.com/unoplatform/uno/issues/10109#issuecomment-1360318219, and it's unlikely that we'll be adding support for this particular feature. It's probably best to use command binding instead.
Thanks for the report. This is looks like a duplicate of #10109 (comment), and it's unlikely that we'll be adding support for this particular feature. It's probably best to use command binding instead.
Why not? WinUI 3 is working there
@jeromelaban Indeed as @FrozDark mentions, this actually does work in UWP/WinUI. I saw the linked issue and the reason why the events were not fired while you tested it is that resource dictionaries with code-behind need to be declared differently in XAML:
This will load the resource dictionary without its code-behind (e.g. no events will work}:
<ResourceDictionary Source="ms-appx:///MyDictionary.xaml" />
This loads the resource dictionary with its code-behind (events should work):
<myRes:MyDictionary />
Current behavior
Xaml parser fails with error
System.Exception: Unable to find x:Class on the top level element
Code behind
Expected behavior
Xaml parse and code generation successfully
How to reproduce it (as minimally and precisely as possible)
Repro: XamlParseUnoAppIssues.zip
Workaround
None
Works on UWP/WinUI
Yes
Environment
Uno.WinUI / Uno.WinUI.WebAssembly / Uno.WinUI.Skia
NuGet package version(s)
Uno 4.10.0-dev.111
Affected platforms
WebAssembly, Android, iOS, macOS (AppKit), Mac Catalyst, Skia (WPF), Skia (GTK on Linux/macOS/Windows), Skia (Linux Framebuffer), Skia (Tizen)
IDE
Visual Studio 2022
IDE version
No response
Relevant plugins
No response
Anything else we need to know?
No response