Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a click behavior for a list?

I have a list view, on a panoramic control. I've also created an event for MouseLeftButtonUp however I find that when scrolling between the panorama items the MousLeftButtonUp is triggering (it makes sense why but it is unexpected from a user perspective).

Is there any way to create a click event for a list? Or add a behavior that simulates that?

like image 871
Sebastian Gray Avatar asked Jan 09 '11 05:01

Sebastian Gray


1 Answers

Checkout the Tap gesture from the Gesture service that's part of the toolkit.

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");
}
like image 112
Mick N Avatar answered Oct 23 '22 00:10

Mick N