Quantcast
Channel: MVVM Light Toolkit
Viewing all articles
Browse latest Browse all 1826

New Post: EventToCommand xaml error, "A value of type 'EventToCommand' cannot be added to a collection or dictionary of type 'TriggerActionCollection'."

$
0
0
Hi.

I'm trying to implement EventToCommand within one of my views, but when I add the code (below), then I get a parser error:

"A value of type 'EventToCommand' cannot be added to a collection or dictionary of type 'TriggerActionCollection'."

Is this code configured correctly? Seems to be the same as many other online examples I've seen. Thanks in advance for any assistance.

xmlns:galaSoft="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.SL5"

<i:Interaction.Triggers>
<i:EventTrigger EventName="KeyDown">
    <galaSoft:EventToCommand Command="{Binding Test}" PassEventArgsToCommand="True" />
</i:EventTrigger>
</i:Interaction.Triggers>

Viewing all articles
Browse latest Browse all 1826

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>