Is there a click behavior for the list?

I have a list view on a panoramic control. I also created an event for MouseLeftButtonUp, but found that when scrolling between pan elements, MousLeftButtonUp is fired (this makes sense, but it is unexpected from the user's point of view).

Is there a way to create a click event for a list? Or add behavior that mimics this?

+5
source share
2 answers

Check the Tap box from the Gesture service for the toolbox.

WP7 Tip of the Day: Silverlight Toolkit: Gestures

    <ListBox Height="100" HorizontalAlignment="Left" Margin="12,186,0,0" Name="listBox1" VerticalAlignment="Top" Width="460" >
        <Controls:GestureService.GestureListener>
            <Controls:GestureListener Tap="GestureListener_Tap">
            </Controls:GestureListener>
        </Controls:GestureService.GestureListener>
        <ListBoxItem Content="1"/>
        <ListBoxItem Content="2"/>
        <ListBoxItem Content="3"/>
        <ListBoxItem Content="4"/>
    </ListBox>

and

public void GestureListener_Tap(object sender, GestureEventArgs e) {
    System.Diagnostics.Debug.WriteLine("tap");
}
+8
source

The box should already have a contact set, so you can just fire the SelectionChanged event

0

All Articles