Binding and Uno.Microsoft.Xaml.Behaviors.WinUI.Managed in different projects #11321
-
I have two projects in my solution. In one project - a library project I added, Library project I added: Default library project added by the template:
I am referencing Uno.Microsoft.Xaml.Behaviors.WinUI.Managed however my project does not recognize it. This article does not indicate that a conditional package reference is required. The samples project references the source projects directly so I can't tell from that if I'm referencing it correctly. Also, I am referencing same nuget in my library project and it works fine.
XAML:
How can I use |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
This article is outdated and conditional references are needed. You'll need something like this: <ItemGroup Condition="'$(TargetFramework)' == 'net6.0-windows10.0.18362.0'">
<PackageReference Include="Microsoft.Xaml.Behaviors.WinUI.Managed" Version="2.0.9" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' != 'net6.0-windows10.0.18362.0'">
<PackageReference Include="Uno.Microsoft.Xaml.Behaviors.WinUI.Managed" Version="2.3.0" />
</ItemGroup> |
Beta Was this translation helpful? Give feedback.
-
Thank you @jeromelaban. I added the references as specified and I still get the same errors. I deleted bin/obj/.vs several times.
It appears that Uno.Community.Toolkit is referencing Uno.Microsoft.Xaml.Behaviors.WinUI.Managed 2.3.1-uno.2. If I try to add 2.3.0 I get a downgrade error from nuget. |
Beta Was this translation helpful? Give feedback.
Thank you @jeromelaban. I added the references as specified and I still get the same errors. I deleted bin/obj/.vs several times.
It appears that Uno.Community.Toolkit is referencing Uno.Microsoft.Xaml.Behaviors.WinUI.Managed 2.3.1-uno.2. If I try to add 2.3.0 I get a downgrade error from nuget.