Question

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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top