locked
UIElement definition is missing Manipulation events?? RRS feed

  • Question

  • Hi, this is totally weird. The Blend 4 UI and the VS2010 UI show the ManipulationDelta/Started/Completed events. If I click on one it generates a handler no problem. When I run it crashes saying that those events are not on the GridSplitter object. In the xaml, Intellisense does not show the events either. I've checked and believe I have the latest versions of the SDK and tools. I tried it with nothing but a fresh Silverlight app that has nothing but Grid and a GridSplitter, so it's not my app.

    Has anyone seen this problem??

    Thanks, Ed

    UPDATE ---------------------------------------------------------------------------

    1) I wiped my Dev machine clean

    2) Reinstalled Windows7 x64 with all Windows updates

    3) Installed retail VS2010

    4) Installed retail Expression Studio 4 Ultimate

    5) Installed VS2010 Silverlight 4 tools

    6) Installed all updates

    I see the same problem!!! 

    The app still bombs when you run it. If I do something simple in code like:

    UIElement btn = new Button();

    Intellisense does not know about the Manipulation events. If I put the cursor on "btn" and hit F12, it shows me the reflected definition, and I can see the events in the definition of UIElement. But they somehow aren't making it to the surface. Very weird.

    So it isn't my app, and I have a totally clean retail installation??

    Anyone?

    Tuesday, July 13, 2010 6:36 PM

Answers

  • From your install steps, it seems that you are not specifically developing for Windows Phone.

    The Manipulation events are NOT available for a Silverlight app that runs browser-hosted or out of browser, attempting to hook a handler for these will throw in the runtime. They show up in the reflected API surface of reference assemblies al because the VS design surface has to provide some common design-time support for both Windows Phone and others. 

    Wednesday, July 14, 2010 3:50 PM

All replies

  • From your install steps, it seems that you are not specifically developing for Windows Phone.

    The Manipulation events are NOT available for a Silverlight app that runs browser-hosted or out of browser, attempting to hook a handler for these will throw in the runtime. They show up in the reflected API surface of reference assemblies al because the VS design surface has to provide some common design-time support for both Windows Phone and others. 

    Wednesday, July 14, 2010 3:50 PM
  • I think you are correct. Unfortunately since the documentation says it's supported and both Blend and VS generate handlers, it is rather misleading. It seems like a blunder to generate code the doesn't work for the project type that's loaded. I'm a little surprised they would hard code events and properties for an object. It would seem more flexible to make property and event editors visible based on whether the object implementation supported them. Perhaps it's for performance reasons...

    Thank you for your help, Ed

    Wednesday, July 14, 2010 7:29 PM
  • Documentation does not say they are supported ...

    http://msdn.microsoft.com/en-us/library/system.windows.uielement.manipulationstarted(VS.95).aspx

      

    Platform Notes

     

    Silverlight 4:

     Do not use in a Silverlight 4 application.
     

    Maybe you were just looking at the Intellisense? The Intellisense from XAML sometimes has other issues where it doesn't quite get the members lists 100% for the Silverlight vs WPF representations of the types supported in the 2006/presentation XAML namespace. So the takeaways are:

    1) Sometimes Intellisense will give you something that won't work, and occasionally this is for other reasons than this case here where there's a Silverlight for Phone / Silverlight for desktops disparity.

    2)  When you run into an issue like that, or think you are, go to the MSDN reference pages and check the platform notes, version supported, whether you are looking at the .NET reference as opposed to Silverlight reference etc.

    Friday, July 16, 2010 2:17 PM
  • Not sure if I was looking at old docs or what, but I didn't see that. Thank you for your time, Ed

    Friday, July 16, 2010 2:29 PM