O'Reilly logo

Windows® Phone 7 Application Development 24-Hour Trainer by Brian Faucher

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 10. Supporting Multi-Touch

This lesson describes the purpose and use of Windows Phone 7 multi-touch behavior. Multi-touch behavior can be used to add scale, to rotate, and to translate gestures to any element in a Windows Phone 7 Silverlight application. To use multi-touch you must first download and install the behavior from CodePlex at http://multitouch.codeplex.com

MULTI-TOUCH BEHAVIORS

The four basic multi-touch behaviors are as follows:

  • Rotate enables you to rotate the object up to 360 degrees.

  • Scale enables you to increase or decrease the size of the object.

  • Translate enables you to move the object around the screen.

  • Inertia applies friction (or easing) to objects when they are moved, allowing the object to stop smoothly. Easing functions allow you to apply custom mathematical formulas to your animations.

While these four basic behaviors can be directly controlled using the ManipulationStarted, ManipulationCompleted, and ManipulationDelta events, the multi-touch behaviors available from CodePlex encapsulate these events and make implementing them easy.

After installing MultiTouchBehaviors.Setup.msi, available from codeplex.com, you must add a reference to the assemblies to your Windows Phone 7 application. The assemblies are installed on your local machine at Program Files\MultiTouch Behaviors\WP7. The two assemblies that need references are:

  • MultiTouch.Behaviors.WP7.dll

  • System.Windows.Interactivity.dll

In order to use these two assemblies on a page you must add the following ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required