A Silverlight / Expression Blend behavior to add Multi-Touch Manipulation and Inertia
I’ve updated the behavior available in the Expression Community gallery adding Multi-Touch manipulation (translation, rotation and zoom) and inertia effects using code from the Surface Manipulations and Inertia Sample for Microsoft Silverlight.
To enable Multi-Touch in your code simply download the behavior from here, add the project “MultiTouch.Behaviors.Silverlight” to a Visual Studio solution and then enable the gestures in XAML:
<UserControl x:Class="SilverlightMultiTouch.MainPage"
...
xmlns:interactivity="clr-namespace:System.Windows.Interactivity; assembly=System.Windows.Interactivity"
xmlns:behaviors="clr-namespace:MultiTouch.Behaviors.Silverlight; assembly=MultiTouch.Behaviors.Silverlight"
...
>
<Canvas>
<Image Source="Images/Desert.jpg">
<interactivity:Interaction.Behaviors>
<behaviors:MultiTouchManipulationBehavior InertiaEnabled="True" TouchRotateEnabled="True" TouchTranslateEnabled="True" TouchScaleEnabled="True"/>
</interactivity:Interaction.Behaviors>
</Image>
<Image Source="Images/Jellyfish.jpg">
<interactivity:Interaction.Behaviors>
<behaviors:MultiTouchManipulationBehavior InertiaEnabled="True" TouchRotateEnabled="True" TouchTranslateEnabled="True" TouchScaleEnabled="True"/>
</interactivity:Interaction.Behaviors>
</Image>
</Canvas>
The MultiTouchManipulationBehavior also contains some dependency properties (TouchRotateEnabled, TouchTranslateEnabled, TouchScaleEnabled and InertiaEnabled) to enable the corresponding gestures.
The example contains Multi-Touch manipulations applied to some Image controls and a Smooth streaming player of the Silverlight Media Framework.
I’ve also posted to CodePlex a sample using WPF 4 based on the article “Introduction to WPF 4 Multitouch“ by Jaime Rodriguez.
Hope this helps and Happy Silverlighting!





January 7th, 2010 at 10:18
[...] Esto es algo que tenia en mente intentar realizar cuando sacase algo de tiempo, pero me alegro que alguien como Davide Zordan lo haya sacado y compartido con nosotros, se trata de un behavior que nos da soporte Multitouch con inercia, tal y como funciona en la Surface, simplificándonos bastante si queremos dar un toque de Multitouch a nuestras aplicaciones, podéis ver el articulo completo esta dirección. [...]
January 7th, 2010 at 14:17
[...] This post was mentioned on Twitter by Kelps Leite de Sousa, Larry King. Larry King said: A Silverlight / Expression Blend behavior to add Multi-Touch … http://bit.ly/7rI0pI #SL #RIA [...]
January 7th, 2010 at 23:22
This is great, Davide! Thanks for the new behaviors
January 7th, 2010 at 23:30
Thank you Adam, glad you like it
Much appreciated!
January 8th, 2010 at 09:59
Could you please signed the silverlight version of the assembly : Surface manipulation and inertia?
Thanks for all !
January 10th, 2010 at 00:54
Hi Eric, I’ve updated the Silverlight version of the assembly.
April 4th, 2010 at 18:06
[...] have already blogged about using Blend behaviors to add Multi-Touch gestures and inertia effects to a generic Silverlight user control, so I wanted to use the same approach to add the same [...]
July 5th, 2010 at 18:58
[...] "A Silverlight / Expression Blend behavior to add Multi-Touch Manipulation and Inertia" http://www.davidezordan.net/blog/?p=1716 [...]
July 5th, 2010 at 19:15
[...] “A Silverlight / Expression Blend behavior to add Multi-Touch Manipulation and Inertia” http://www.davidezordan.net/blog/?p=1716 [...]