Is there a click behavior for a list?

后端 未结 2 474
夕颜
夕颜 2021-01-01 02:15

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 MousLeftButto

相关标签:
2条回答
  • 2021-01-01 02:47

    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");
    }
    
    0 讨论(0)
  • 2021-01-01 03:03

    The listbox should already accept contact, so you can just fire the SelectionChanged event

    0 讨论(0)
提交回复
热议问题