Selecting a ListView item in a Windows Store

I want ListView to behave like this:

With mouse Login:

  • Left-click → The event handler of the click element will be executed, but should not display it as "selected"
  • Right click -> item is selected

With touch input:

  • Single Tap -> equivalent to left click
  • Scroll down → equivalent to right click

I played with various events and settings, but could not get it to work correctly.

+1
source share
2 answers

In other words, do you want your list to appear as a Windows startup screen? It was cruel for me to understand - part of the mouse was light, but the sensory part is not so much. The solution turned out to be quite simple. You just need to include the necessary options for your list. Here's the haml for mine:

<ListView x:Name="itemListView" SelectionMode="Extended" IsSwipeEnabled="True" IsItemClickEnabled="True" ItemClick="ItemView_ItemClick" /> 

Sorry, I haven't figured out how to get the code to highlight in StackOverflow yet.

+2
source

It can help you with mouseclicks.

  private void MainForm_MouseDown(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) method() if (e.Button == MouseButtons.Right) set selection = false method() } 

and for the pen, I hope this helps

http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh465387.aspx

0
source

All Articles