question

CharlesHe-MSFT avatar image
CharlesHe-MSFT asked ·

WPF Listview touch issue on window 10: "an event of another datatemplate is triggered while it may not happen"

This a MSDN question asked by Free_development, the source is WPF Listview touch issue on window 10: "an event of another datatemplate is triggered while it may not happen"




Before we start:- (links will be provided later)

Detailed information of the problem can be found on stackoverflow.

We have created a simple test-project, which is used to simulate the problem on windows 10 (touch only), and can be found on github.

In short below a summary of the technical setup:

  • We use a grouped listview, and for each group, a togglebutton and another (inner) listview.

  • The inner listview uses an ItemTemplateSelector binded to an Datatemplate selector, to choose an datatemplate.

  • There are 3 datatemplates (checkbox, numeric, text) that will be choosen based upon the type property of the bounded model.

  • Each datatemplate has a stackpanel. The stackpanel in the text en numeric datatemplate is wired to an PreviewMouseDown event.

  • Important, the stackpanel in the checkbox isn't wired to an event.

So, what is the problem?: Sometimes, when touching the checkbox, the PreviousMouseDown of another template is triggered.

I would expect that this behavior may not happen, is that correct?

Also if we no longer listen to the stylus event and configuring to DisableStylusAndTouchSupport the problem can no longer be simulated?

Any idea's, or insights on the rootcause of this problem or a solution?




windows-wpf
3 comments
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Please provide your code and share your screenshot so we can assist you.

0 Votes 0 · ·

Hi AlexLi,


Details with code and screenshots can be found on stackoverflow The code itself can be found on github


Looking forward on your feedback.


Regards Free


0 Votes 0 · ·

Hi Alexili

Did you find time to investigate in this problem?

Regards Free

0 Votes 0 · ·

0 Answers