Skip to content
This repository has been archived by the owner on Sep 20, 2021. It is now read-only.

MvvmLight with Microsoft.Xaml.Behaviours - Unable to use behaviour assets #96

Open
ghost opened this issue Dec 18, 2020 · 1 comment
Open

Comments

@ghost
Copy link

ghost commented Dec 18, 2020

Is not possible to use the Nuget package Microsoft.Xaml.Behaviours with MvvmLight library.

As I can see there's an incompatibility between System.Windows.Interactivity and Microsoft.Xaml.Behaviours because the share the same namespace.

As result if you add both packages to a project (net 4.7) and open blend is not possible to normally use behaviours from behaviour asset list.

Any idea to fix it?

Thank you
Lox

UPDATE
Even if Blend is not capable to manage wpf behaviours from asset list, is still possible to do it by hand adding the
xmlns:b="http://schemas.microsoft.com/xaml/behaviors" directive in the head of the xaml and then using them like this:

<b:Interaction.Triggers>
    <b:DataTrigger Value="True" Binding="{Binding IsBusy}">
        <b:GoToStateAction StateName="Busy" TargetObject="{Binding ElementName=MainGrid}" />
    </b:DataTrigger>
</b:Interaction.Triggers>
@michael-hawker
Copy link

@LMFLox if you migrate to the new MVVM Toolkit from MVVM Light, you shouldn't have any troubles mixing it and the XAML Behaviors package: https://docs.microsoft.com/en-us/windows/communitytoolkit/mvvm/migratingfrommvvmlight

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant