In these days I’m receiving several questions in the Multi-Touch Behaviors forums about enabling Multi-Touch manipulations in Windows Phone applications composed by more than one page.
Today I’ve modified the available sample inserting an additional page containing an image enabled for translation, rotation, zoom and inertia via the usual “MultiTouchBehavior“:
Starting from release 0.6.1 it’s now possible to use the Behavior in different pages of the application, in this way enabling multi-touch in different elements of a Windows Phone 7 application:
As usually the sample code is available for download on http://multitouch.codeplex.com, check out the Visual Studio solution “SilverlightWP7MultiTouch.sln” which contains all necessary libraries.
I’ve just finished some experiments using the Windows Phone 7 emulator and the “Microsoft Surface Manipulations and Inertia Sample for Microsoft Silverlight” in order to enable Multi-Touch gestures using Blend Behaviors:
This new implementation, now available for download in the Expression Gallery, permits to enable Multi-Touch gestures (the usual translation, rotation, zoom and inertia) on separate User Controls available in the same container.
In this way you can apply distinct Multi-Touch manipulations (inertia included) to single elements using a single code in xaml:
<Grid x:Name="ContentPanel" Grid.Row="1">
<Image Source="Images/Desert.jpg" x:Name="image1">
<WP7:MultiTouchManipulationBehavior IsInertiaEnabled="True" IsRotateEnabled="True" IsTranslateEnabled="True" IsScaleEnabled="True" MinimumScaleRadius="1" MaximumScaleRadius="720"/>
<Image Source="Images/Jellyfish.jpg" x:Name="image2">
<WP7:MultiTouchManipulationBehavior IsInertiaEnabled="True" IsRotateEnabled="True" IsTranslateEnabled="True" IsScaleEnabled="True" MinimumScaleRadius="60" MaximumScaleRadius="360"/>
Alternatively you can use Blend inserting a reference to the project MultiTouch.Behaviors.Silverlight.WP7 and then dragging the MultiTouchManipulationBehavior from the Assets section to the control to be touch-enabled:
This one has been an interesting exercise in porting code written for Silverlight to Windows Phone: I had only to create a Windows Phone 7 project and add to it the code already available for the Silverlight version and all worked well quite quickly.
At this time the behavior works only in the fixed Portrait orientation of Windows Phone: if you change to Landscape the manipulation doesn’t work well. I’ll have to investigate further and currently I don’t have a physical device to test (I’d really love to have a device to try it ).
Currently Silverlight isn’t available on mobile devices, as stated in this post by Bart. However it’s already possible to run SL RIAs on Windows Mobile using the Skyfire browser.
Just download and install the browser on your mobile phone and you’re ready.
Click here to read a great summary (by Bart Czernicki) of the Silverlight-related information presented at PDC2008.
The video of the talk taken by Giorgio Sardo and Amit Chopra is available here.
As reported by Chris Hayuk in this post, you do not have to do anything to make your Silverlight Application to make it work on the mobile, no recompiling, nothing.
The public CTP should be available Q1 2009, so in the meantime we could start to use the MVC pattern, as suggested by Bart in this article.
Check out this great article by Giorgio Sardo contained in the September issue of the Expression newsletter.
If you waiting for Silverlight on mobile, take a look at Skyfire, “a free, downloadable mobile browser that delivers rich web media, real fast”.
It now supports Silverlight content.
Click here to read the post by Chris Koenig.
Click here to watch the video.
The session list is available here.
There are many interesting topics about:
- Live Mesh Platform and Cloud Services Architecture;
- Developing Silverlight for Mobile and Business applications;
- Windows 7 Touch computing and Web Services in native code (!);
- Developing for Windows Mobile.
Click here to watch this great track by Giorgio Sardo.