I'm going nuts on this one: I have an application using both Mahapps.Metro as well as MVVMLight. Basically most things are ok UNTIL you try to use Interaction.Triggers.
I typically end up with errors like
Cannot add instance of type 'EventToCommand' to a collection of type 'TriggerActionCollection'. Only items of type 'T' are allowed.
A way to reproduce this is via a repo I found online: https://github.com/mike-schulze/mahapps-mvvmlight-setup (sorry mike for hijacking) and adding a metro SplitButton to the viewmodel:
<Controls:SplitButton ItemsSource="{Binding MyList}" Grid.Column="1" Grid.Row="1">
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<cmd:EventToCommand
Command="{Binding Mode=TwoWay, Path=SelectionChangedCommand}"
PassEventArgsToCommand="True"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</Controls:SplitButton>
And MyList being
public List<string> MyList
{
get
{
List<string> theList = new List<string>();
theList.Add("Hello");
theList.Add("World");
return theList;
}
}
I'm not sure how many different namespaces, hard coded Interactivity versions in App.config or what so ever I tried.
Has anyone a working example with Mahapps Metro (version not too old) and MVVM Light and the EventToCommand stuff?
I thought my problem is related to updates to Metro - and them using Behaviors now instead of Interactivity. I'm using the Interactivity dll version 4.5.0.0. But even the old git I mentioned above shows the problem... And I can't find a working solution.
Any help is greatly appreciated. Thanks