Dec 19 2010

Using the Multi-Touch Behavior in a Windows Phone 7 Multi-Page application

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:

<Canvas>
    <Image x:Name="_image"
        Source="{Binding SelectedPicture}">
        <interactivity:Interaction.Behaviors>
            <behaviors:MultiTouchBehavior
                    IsInertiaEnabled="True"
                    IsTranslateXEnabled="True"
                    IsTranslateYEnabled="True"
                    IsRotateEnabled="True"
                    IsScaleEnabled="True"
                    MinimumScale="30" MaximumScale="200"
                    AreFingersVisible="False"/>
        </interactivity:Interaction.Behaviors>
    </Image>
</Canvas>

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.

Happy Silverlighting!


Aug 1 2010

Windows Phone 7, Multi-Touch Behaviors and the Surface samples for Silverlight

I’ve just finished some experiments using the Windows Phone 7 emulator and the “Microsoft Surface Manipulations and Inertia Sample for Microsoft Silverlightin order to enable Multi-Touch gestures using Blend Behaviors:

WP7BehaviorExpression

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">
  <Canvas>
      <Image Source="Images/Desert.jpg" x:Name="image1">
          <interactivity:Interaction.Behaviors>
               <WP7:MultiTouchManipulationBehavior IsInertiaEnabled="True" IsRotateEnabled="True" IsTranslateEnabled="True" IsScaleEnabled="True" MinimumScaleRadius="1" MaximumScaleRadius="720"/>
          </interactivity:Interaction.Behaviors>
      </Image>

      <Image Source="Images/Jellyfish.jpg" x:Name="image2">
          <interactivity:Interaction.Behaviors>
             <WP7:MultiTouchManipulationBehavior IsInertiaEnabled="True" IsRotateEnabled="True" IsTranslateEnabled="True" IsScaleEnabled="True" MinimumScaleRadius="60" MaximumScaleRadius="360"/>
          </interactivity:Interaction.Behaviors>
      </Image>
  </Canvas>
</Grid>

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:

Multi-Touch Behavior Blend

 

Considerations

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.

Limitations

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 :) ).

Happy Silverlighting!


Apr 27 2009

Quick tip: how to run a Silverlight application on a Windows Mobile device

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.

Enjoy!


Nov 3 2008

PDC 2008 – Silverlight 2 Wrap-Up

Click here to read a great summary (by Bart Czernicki) of the Silverlight-related information presented at PDC2008.


Oct 29 2008

Silverlight 2 for Mobile announced at PDC

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


Sep 28 2008

Building Mobile User Experiences

Check out this great article by Giorgio Sardo contained in the September issue of the Expression newsletter.


Aug 22 2008

Skyfire: Silverlight goes mobile

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.

 


Aug 18 2008

Video: Silverlight Mobile with John L Scott Real Estate

Click here to watch the video.


May 29 2008

PDC 2008 Sessions Overview

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.

 


May 21 2008

Developing Silverlight for Mobile applications (in Italian)

Click here to watch this great track by Giorgio Sardo.