Issues with XAML Behaviors #13494
-
Since UNO Platform doesn't support XAML triggers, I am trying to use the XAML Behaior with no success. Here is the steps I take to create and configure a project and fail:
At this point, the project builds and runs on both platforms (Windows and web assembly)
3.2. Add a button with a basic behavior from the sample code as below:
At this point I expect the code to be running with the expected behavior. But I get this error:
I would appreciate it if there are any tips to resolve the issue. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 17 replies
-
Hello, @majidkhalili. To solve this problem check the Uno documentation and try to use the following steps: <ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">
<PackageReference Include="CommunityToolkit.WinUI.UI.Behaviors" Version="7.1.2"/>
</ItemGroup>
<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) != 'windows'">
<PackageReference Include="Uno.CommunityToolkit.WinUI.UI.Behaviors" Version="7.1.200-dev.6.gf657bb2e91"/>
</ItemGroup> |
Beta Was this translation helpful? Give feedback.
-
@limeniye Do you mean I have to use the uno-comunity-toolkit (Uno.CommunityToolkit.WinUI.UI.Behaviors) instead of XAML Behavior (Microsoft.Xaml.Behaviors.WinUI.Managed)? |
Beta Was this translation helpful? Give feedback.
-
I have issue with xaml Behaviors. I have created new project using latest uno templates, added one package Uno.Microsoft.Xaml.Behaviors.WinUI.Managed as described here https://github.com/unoplatform/Uno.XamlBehaviors As soon as i add
to my page i get error below and can't build: Severity Code Description Project File Line Suppression State Details I |
Beta Was this translation helpful? Give feedback.
-
@limeniye thank you i will try to use Communitytoolkit.WinUI.Behaviors but does it include Behaviors from https://github.com/Microsoft/XamlBehaviors/wiki ? |
Beta Was this translation helpful? Give feedback.
-
@limeniye sorry but im still confused. I am looking at this: In the page namespace declarations i see:
does that mean in my Uno App i also need to include
? Is there any example on how to use Behaviors from CommunityToolkit in Uno app ? |
Beta Was this translation helpful? Give feedback.
Hello, @majidkhalili.
Thank you for your report.
To solve this problem check the Uno documentation
https://platform.uno/docs/articles/uno-community-toolkit.html
and try to use the following steps:
#13192 (comment)