> > >
Silverlight / Windows Phone 7 Multi-Touch Manipulation and Inertia Behavior
Express yourself! Share your work with other members of the Expression Community.

Each contribution is licensed to you under a License Agreement by its owner, not Microsoft. Microsoft does not guarantee the contribution or purport to grant rights to it.

Silverlight / Windows Phone 7 Multi-Touch Manipulation and Inertia Behavior

Average Rating:  (20)
Description
Discussions (9)

  • Events
    2 Posts | Last Post July 23, 2011
    • Hi Davide, I need to trap events regarding users images movement, for example : Touch down, touch release, image moving, scale changed.., but only Events who MultiTouchBehavior class exposes are ManipulationStarted and ManipulationCompleted. I'm using Siverlight4 interfaces and i've not yet a multitouch device so I'm using only the mouse.
      can you explain me how can i get this  events?
      
      
    • Hi Luca,
      currently the Behavior handles only Manipulation events.
      If you want to handle single touch events you have to look at the code available in the class "MultiTouchManipulationBehavior.cs" and modify it for your needs using the raw touch apis and the available TouchHelper.
      
      Thanks,
      Davide
  • Containing
    3 Posts | Last Post March 31, 2011
    • I'm relatively new with this; I was wondering if it's posible to somehow prevent part of the image to go of screen?
    • Sorry forgot this; whitout restraining the zooming maximum.
    • Yes, adding some sort of max translate bounds would be nice.
  • Code
    4 Posts | Last Post January 12, 2011
    • Nice video choice
      
      Did you write this in C#?
    • Hi RivieraStudios,
      yes, love this Smooth streaming video :)
      
      Yes, used C# and code from here: http://www.microsoft.com/downloads/details.aspx?displaylang=en
    • Oh, sorry, this is the right link: http://tinyurl.com/y8oyfqr
    • Hello Davide,
      I have an issue with your behavior, I load it expression blend and run it in the device. I zoom in on the image and cant see the edges. For example I want to use the behavior for a picture of a map and be able to zoom in on the edges of the map. I can post a video or send you the .xap file of the issue I am having.
  • Get touched object?
    2 Posts | Last Post December 01, 2010
    • Using your example with the 3 elements above would it be possible to outline in red for example the currently selected element and keep that outline when the finger is removed. If the user touches another element then that one is outlined and the previous element is no longer outlined. This would indicate the currently "selected" element. Then have no element outlined if the user touches the screen where there are no elements.
      
      I see that your behavior is doing something to bring the touched element to the front. Is that with the Zindex? My elements are all created in code, how could I access the foreground element in CS?
      
      TIA.
    • Thanks for the suggestion about the selected element.
      Yes, the behavior uses ZIndex.
      To access the foreground element you can test your Canvas.Children and look for the ZIndex property of the elements.
  • Can single finger rotation be turned off?
    4 Posts | Last Post December 01, 2010
    • I see that IsRotateEnabled is an option but I was wondering if it's possible to allow rotation but only with two fingers.
      
      Thanks for the great behavior!
    • Hi,
      thanks for the kind words and the suggestion!
      
      I'll verify it and insert a ticket in the Codeplex project, stay tuned on http://multitouch.codeplex.com for other news!
      
      Thanks,
      Davide
    • Thanks for the quick response! Is that the better place to ask questions about this behavior?
    • No problem, feel free to post your questions where you prefer :)
      
      Thanks,
      Davide
  • Strange behavior on WP7
    5 Posts | Last Post September 30, 2010
    • Ive got a simple page which is defined as below:
      
      <Grid x:Name="LayoutRoot" Background="Transparent">
      		<Grid.RowDefinitions>
      			<RowDefinition Height="*"/>
      		</Grid.RowDefinitions>
      		<Image x:Name="TheImage" Grid.Row="0">
      			<Custom:Interaction.Behaviors>
      				<MultiTouch_Behaviors_Silverlight_WP7:MultiTouchManipulationBehavior IsRotateEnabled="False" MaximumScaleRadius="960" MinimumScaleRadius="480" IsScaleEnabled="False"/>
      			</Custom:Interaction.Behaviors>
      		</Image>
      	</Grid>
      
      And when the Page loads, the image is pushed out of the screen to the left, and it seems that the boudaries of the manipulation are all screwed up... You can pan across to the right, but only so the very right hand side of the image touches the right side of the screen (no more) and you can pan left until the image is entirely out of the left side of the screen, which is less than desirable.
      
      thanks for the great effort so far, if you could help me out, that would be great!
    • Thanks for the feedback! Much appreciated.
      At this time you can set the initial position of the Image via code behind using the following code (also available in the sample):
                  System.Windows.Interactivity.Interaction.GetBehaviors(image1).OfType<MultiTouchManipulationBehavior>().First().Move(new Point(100, 250), 45, 100);
      
      It's already planned the possibility for setting the initial position / transformations in XAML and to optimize the detection of the boundaries, hope to get these new bits available asap :)
    • As soon as I posted I took a look and the sample and saw that :) Thats ok, Im not too fussed about that, but the darn boundaries are still getting me. I dont know why they are doing what I described. Can you tell me, is the Point you set the center of the image? And also, what is the scale radius relative to?
    • Actually the point is set to the center of the image as used in the Surface samples. Same for scale radius: ideally you should divide that parameter for 3.6 to obtain the percentage of the allowed scaling.
      Of course I'm planning a refactoring of those behaviors in order to make the usage simpler, but it's all connected to a general refactor/optimization of the core.
    • Sorry, not quite sure I follow, do you think you could elaborate further for me?
  • Silverlight 4
    5 Posts | Last Post June 03, 2010
    • Davide, now that SL4 has been released, any plans to port to SL4?
    • Hi SPBGEB,
      sorry for the delay in the answer, just read your question :)
      
      You can use the behavior in SL4, you have only to load the solution using VS2010/SL4 and you're done :)
      
      By the way let me know if you need an updated version, I'll post it.
    • I've inserted a SL4 folder with the solution ported to Silverlight 4 / VS2010.
      Hope this helps.
    • Great sample Davide, thanks for sharing!
    • @Jose thanks :)
  • Properties
    3 Posts | Last Post May 28, 2010
    • Can you please make Center, Radius, and Orientation public properties "protected set is ok" for the MultiTouchManipulationBehavior object.  I need to be able to get at them for rezising and positioning from code behind.  Thanks!!!!!  SL3
    • Hi Tom,
      I'll upgrade soon the behavior to Silverlight 4 and insert these changes as well.
      
    • The properties Center, Radius and Orientation are now using a protected modifier. The updated code is available in the "SL4" section.
      Hopt this helps.
  • i want to use Multi Touch Feature in windos7
    2 Posts | Last Post January 06, 2010
    • i want to use Multi Touch Feature in windos7
    • Hi,
      please read this post: http://www.davidezordan.net/blog/?p=1136
      
      If you use Visual Studio 2010 Beta please refer to http://multitouch.codeplex.com/
      
      Hope this helps.

Details

Rate it:
 
 
 
 
 
  • Share It:
    E-mail Twitter del.icio.us Digg Facebook
  • Add To Favorites
  • Published: 1/6/2010
  • Tags: Silverlight, Behavior, Multi-Touch, Silverlight 4, Touch, Windows Phone 7
  • License Information:
    This contribution is licensed to you under Creative Commons by its owner, not Microsoft. Microsoft does not guarantee the contribution or purport to grant rights to it.