Hello my mvvm followers :D
I found actually 2 ways to handle mouse events on controls with the mvvm pattern.
Both ways are actually 1 way:
MVVM Light Toolkit by http://mvvmlight.codeplex.com/
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<cmd:EventToCommand
Command="{Binding SelectionChangedCommand}"
CommandParameter="{Binding SelectedItems,
ElementName=MyDataGrid}" />
</i:EventTrigger>
</i:Interaction.Triggers>
and the Blend interactivity.dll with Behaviours
<i:Interaction.Triggers>
<i:EventTrigger EventName=”MouseLeftButtonDown”>
<Behaviours:ExecuteCommandAction Command=”{Binding MyCommand}” CommandParameter=”{Binding MyCommandParameter}”/>
</i:EventTrigger>
</i:Interaction.Triggers>
Do you know of any better method?
Moderator: Why the heck are my last 6 xaml lines of code not visible at all? They are swallowed by IE and Iron browser. Would you please report the admin to fix that code script? its not working at all very often. prove: http://img251.imageshack.us/img251/5236/errorxt.png