I am using Visual Studio 2010 SP1. I've met a lot of articles where describes code of event handling(see below). For example this and this one.
I've added an assembly System.Windows.Interactivity
. I am using ICommand
interface to handle Commands. However, when I write a property "Command" in the line:
<i:InvokeCommandAction Command="{Binding SelectionChangedCommand}"/>
I catch an error: Property "Command"
does not exist in namespace XML "clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"..
<ListBox ItemsSource="{Binding SomeData}" Grid.Row="2" Margin="10" Background="LightGreen">
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseEnter">
<i:InvokeCommandAction CommandName="{Binding SelectionChangedCommand}" CommandParameter="{Binding YourCommandParameter}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</ListBox>
Thus I have two questions:
Where can I get a property
Command
? Or what should I write instead of it? I've tried to writeCommandName
but I've caught an error.What should I write to
CommandParameter
property? What type of a property should I create in a viewmodel to bind it toCommandParameter
?