x:Bind on a ResourceDictionary with code behind results in error for WASM #13545
Unanswered
andrewkdci
asked this question in
Q&A
Replies: 1 comment 4 replies
-
|
Duplicate of #12495 |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In WinUI and UWP, you can create a resource dictionary with a code-behind class, which then allows you to use x:Bind inside that resource dictionary. This works fine for WinUI when using Uno, but when I try this with a WASM head I get the following error:
1>CSC : error UXAML0001: Unable to find x:Class on the top level elementDoes anyone know how to resolve this error? Or is it just impossible to use x:Bind from a Resource Dictionary for a WASM head?
As an example, I created a small project to demonstrate this.
App.xaml:
MainPage.xaml:
MyControl.cs:
ResourceDictionary1.xaml:
ResourceDictionary1.xaml.cs:
This is the build error I get when building for WASM:
My project is targeting .NET 7, btw.
Beta Was this translation helpful? Give feedback.
All reactions