0
votes

I use LongListSelector to render my db items, Item_SelectionChanged - is default procedure when I click any item. I need to place extra button on LongListSelector item, with different "click" method. But doing this way every time I execute OtherClickOption code it also triggers Item_SelectionChanged as well. Is it possible to prevent this event?

<phone:LongListSelector
   x:Name="ItemsLongListSelector"
   SelectionChanged="Item_SelectionChanged">
<phone:LongListSelector.ItemTemplate>

<DataTemplate>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="73"/>
        </Grid.ColumnDefinitions>

        <TextBlock Grid.Column="0" Text="{Binding ItemText}"/>
        <Button Grid.Column="1" Click="OtherClickOption" />
......
1

1 Answers

0
votes

First, remove the SelectionChanged event from the LongListSelector. Then add something like a transparent grid to your DataTemplate covering the UI other than the Button and add a Tapped event handler to it where you execute the code you used to execute in the SelectionChanged event handler (modified of course).