Windows 10 Development Diary (ii)--Gesture sequence survey

Source: Internet
Author: User

The previous article continued, the book connected to the previous one.

Last talk about WINDOWS10 gestures divided into high school low three grades, so the whim want to study how these three levels of operation sequence is how? Manipulation gestures of the sequence of the triggering of several events, when to trigger starting, when to trigger started? UserControl itself has a virtual method: onmanipulationstarting,onmanipulationstarted, it has manipulationstarted at the same time, manipulationstarted events, why do functionally similar things have different ways of triggering the sequence of what they are? So these are the questions that make up this article today.

Simply put, this article is designed to address several of the following questions:

1. Trigger sequence for pointerpressed,manipulationstarting,tapped events

2. UserControl Rewrite method: Mainpage_manipulationstarting (), mainpage_manipulationstarted () Order of execution of the registration method with UserControl's Manipulationstarting,manipulationstarted event

3. Trigger conditions for manipulationstarting and manipulationstarted.

First question:

This only need to write a relatively simple demo, you can find out this order: Pointerpressed will be triggered first, manipulationstarting second, only the finger or mouse release will trigger the tapped event. What's worth saying about the tapped event is that the MSDN explanation is: because there are other hands such as holding, when the finger is pressed, you are not sure what the event will be triggered, only after the finger release, will be based on the appropriate conditions to determine exactly what the event.

From the results, the Pointerpressed event will be triggered first, a bit out of my expectation, because the manipulationstarting explanation given on MSDN is: This time will start manipulation Processor, It seems that this means that the manipulation processor is monitoring the manipulation series of events.

After all, pointerpressed and manipulationstarting belong to the framwork layer of time, should be the framework of the order of decision.

However, these three events are parallel events, that is, regardless of which event is marked as Handled, E. Handled = True does not affect the other two events, and only affects events that do not continue routing.

Second question:

to study the problem is out of my curiosity, the same role of things, why should there be two forms? Honestly, I don't know why, and MSDN doesn't seem to give a definite answer, it just says,onmanipulationstarting Represents a Prewired event handler for the uielement.manipulationstarting Event. This overloaded method is called before the events, and this method executes before all other manipulation events are triggered, so you can control the routing of Gesture events by controlling event data.

Still didn't say why to have this method ...

But this solves the second problem, the problem of execution order, the overriding method executes first, then the corresponding event of the control is triggered, not just starting oh, if you don't believe, you can try, delta,completed are the same.

Question three:

before a colleague asked me, how Win10 on the screen can capture this event, and get this point, feel manipulationstarted event is not very sensitive AH. Indeed insensitive, I decided to start with the manipulationstarted incident:manipulationstarted represents that the manipulation recognition logic has detected pointer movement. 。 See no: The move is detected, that is, it must be moved before this event is triggered.

But the PC and phone are inconsistent with the situation: the use of the mouse on the PC, the press does not move, will also trigger the Manipulationstarted event, the same, the phone will not, you must press after a little move, The manipulationstarted event is triggered. There are many points here, if the friend who knows the answer can tell me

OK, say back to manipulationstarting:occurs when the manipulation processor is first created. That is, this event triggers the action processor to be called up and monitors the triggering of subsequent events. The popular point is: when you hand pointing, this event will be triggered, this event will be able to answer the doubts of colleagues.

I know a lot of friends are with the last chapter of the question to see this chapter, I am sorry to divergent, the answer is immediately answered.

Windows 10 Development Diary (ii)--Gesture sequence survey

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.