Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Manipulations and Inertia in the Core Layer

The .NET Framework 4 manipulation processor enables your application to track changes that are made to touches in a touch point collection. When users interact with an application that uses the manipulation processor, they can move, rotate, and scale objects on the Microsoft Surface screen. Changes that are made by a user's fingers are interpreted together with other touches that are part of the manipulation collection. You can create multiple manipulation processor objects simultaneously to support more than one set of hands.

When a new TouchPoint object is created and added to the list of available contacts (a ReadOnlyTouchPointCollection object that is obtained through the GetState method), your application can copy the information from the TouchPoint object to a Manipulator2D structure and then pass the Manipulator2D structure to the .NET Framework 4 manipulation processor. The manipulation processor then raises events, which your application can handle to update the visual component in an appropriate way.

A manipulation consists of one or more manipulators. An application or control provides information about manipulators to the manipulation processor by calling the ProcessManipulators method and passing in the collection of Manipulator2D structures.

Each Manipulator2D structure represents the state of the manipulator and has a unique identifier (ID). For TouchPoint objects, you can use the Id property.

When an application calls ProcessManipulators, the state of the manipulation is recalculated. Any applicable change causes manipulation events to be raised.

Using Manipulations

For detailed information about how to use manipulations in your Surface applications, see the Manipulations and Inertia Overview. You can also find code examples for XNA applications in the following topics:

Manipulation Examples

For a complete code sample that shows how to use manipulations in a Surface application, see the XNA Scatter and Cloth SDK samples that comes with the Surface SDK. The XNA Scatter sample implements behavior that is similar to the Presentation layer ScatterView control.

Did you find this information useful? Please send us your suggestions and comments.

© Microsoft Corporation. All rights reserved.
© 2015 Microsoft