Reputation: 6478
Any idea why my EventTrigger is not being triggered for my item which is part of a listboxitem template using the following code:
<TextBlock Text="{Binding FieldLabel}" Grid.Column="0" Margin="5,0,0,0" Foreground="Black">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Tap">
<i:InvokeCommandAction x:Name="FieldLabelTap" Command="{Binding DisplayInfoCommand, Mode=OneWay}" CommandParameter="{Binding}" />
</i:EventTrigger>
</i:Interaction.Triggers>
</TextBlock>
I've spent a ridiculous amount of time on this, but I just can't figure out what I'm doing wrong or what I'm missing.
Thanks.
Upvotes: 0
Views: 1364
Reputation: 6478
Problem solved! I had ICommand for DisplayInfoCommand defined in the wrong ViewModel i.e. ListBoxViewModel, when it should have been defined in my ListBoxItemViewModel where the FieldLabel is actually defined.
Upvotes: 1