I began to use MVVM pattern yesterday.But for working with events i needed to install MVVM light toolkit.I did that,and added library to references.At UserControl i announced that library,but when i want to use toolkit whatever i write it doesnt show any suggestions and doesnt accept what i want to write and shows this error "A value of type 'EventToCommand' cannot be added to a collection or dictionary of type 'TriggerActionCollection' "
<EventTrigger RoutedEvent="TextChanged">
<mvvm:EventToCommand Command="{Binding Test}"/>
</EventTrigger>
`
You have to use it like this ..
Namespace to add :
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
Dont forget to add a reference to
System.Windows.Interactivity
to your projectYou need To Use
PassEventArgsToCommand="True"
inAnd then you can get that at ViewModel ..... you Might Need to use
Generic RelayCommand
as