locked
trouble in handling click and touch events on listview in xaml RRS feed

  • Question


  • I have created a listview in xaml. My requirements are-

         Mouse click  

    left click - leftclick handler and get the selected item index
    right click - rightclick handler and get the selected item index

         Touch   

    tap - same behavior as left click
    swipe - same behavior as right click

    My code :

    <ListView x:Name="myList" ItemsSource="{Binding myList}"
     SelectionMode="Single" IsSwipeEnabled="True" Tapped="onItemSelected" 
     RightTapped="onItemRightTapped"/>

    I want only one item to be selected at a time.
    On left clicking, event handler is invoked and i can use the selected index.
    On right clicking, i am facing trouble to invoke the handler and find the selected index.

    Any help ?

    Monday, January 6, 2014 4:08 AM

Answers

All replies