WPF 4 and VE

Jul 6, 2009 at 9:57 AM


I've tried simulating touch with Windows 7 using 2 mice successfully.

I've also downloaded and ran the Surface Globe application in the TouchPack. The interaction with the globe is really natural.

I'm trying to emulate that using WPF 4's manipulation engine. I'm wondering if you guys are going to churn out a WPF 4 multitouch version? or is there a way to use Windows 7 multitouch events together with the VESurface control? Since VESurface control has built-in gestures interaction already.



Jul 6, 2009 at 4:43 PM

We don't have plans at the moment to do a version using the Windows 7 API, but if you wanted to then you could use the relationship between SurfaceVEMap and VEMap as a model.  Copy all the files over and replace references to the Surface API, manipulation processors, etc., with the Windows 7 API and WPF 4 manipulation processors. 

Jul 7, 2009 at 8:12 AM

hi there,

im trying to emulate/convert the code in SurfaceVEMap.cs

i believe WPF4 doesnt have a "Affine2DManipulationProcessor" and "Affine2DInertiaProcessor" equivalent classes, so i just enable manipulation and add the manipulation events with the respective handler to the VEMap control.

can you explain what does the manipulationProcessor_Affine2DManipulationCompleted() code is doing and do you know if there is a way to get the number of contacts in the manipulation?

and i would like to know, can the SurfaceVEMap control do multi-finger panning? and does the Surface Globe aplication in the Win 7 Touch Pack uses your VE control?

thanks and regards


Jul 7, 2009 at 11:14 PM

I'm not fully familiar with the WPF4 APIs (too busy doing production stuff to learn pre-release stuff) so I can't advise you on that.

manipulationProcessor_Affine2DManipulationCompleted is called when a manipulation is completed, that is, when the last contact (finger, blob) is lifted.  It resets and starts two inertia processors to continue the same motion for a while.  One inertia processor handles the residual panning and another handles residual zooming.  Notice in the manipulationProcessor_Affine2DManipulationStarted method, it ends the two inertia processors.  This matters so that if you flick the map, it will keep moving for a bit (and slow down gradually) but then stop again if you put down a finger.

SurfaceVEMap indeed handles multi-finger panning.  It takes all contacts into account when deciding the panning and zooming motions.

I very much doubt the touch pack uses this control. 

Jan 4, 2010 at 7:56 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Jan 7, 2010 at 8:14 PM
Edited Jan 7, 2010 at 8:15 PM

If you just want to get the existing InfoStrat.VE assemblies working AS IS in a WPF 4 app, you can put the following in your app.config:

<?xml version="1.0"?>


  <startup useLegacyV2RuntimeActivationPolicy="true">

    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client"/> <!-- Or target the full framework... -->



Feb 20, 2010 at 4:29 PM


Thanks keydet for this, but when I add a App.config file to my project and copy over what you've given, it still says that:

Unable to load the metadata for assembly 'InfoStrat.VE.Windows7Touch'. This assembly may have been downloaded from the web.  See http://go.microsoft.com/fwlink/?LinkId=179545.  The following error was encountered during load: Could not load file or assembly 'InfoStrat.VE.Windows7Touch, Version=, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

Do you have an idea why?



Feb 22, 2010 at 9:39 PM

This thread is somewhat dated.  There is a WPF4 version available now.  Have a look at the latest changeset in source control.


As of 39350, Josh uploaded the WPF4 port.

Feb 22, 2010 at 9:45 PM

Oh gosh! I didn't see that!

Thanks a lot for the info, I'll try it ASAP


Feb 22, 2010 at 10:37 PM

In the latest source drop, be aware there are a few bugs (that's why I haven't pushed it to the main downloads page.)

One is here: http://bingmapswpf.codeplex.com/Thread/View.aspx?ThreadId=83371

Feb 23, 2010 at 9:31 AM

Thanks Josh, I'll correct that in my copy!

Feb 24, 2010 at 1:36 PM

Thanks guys, now I can get it working!

It just took some time to figure out that I still have to use an app.config file as keydet mentioned it.


Mar 15, 2010 at 6:03 PM

Guys please help me... I got this error :

"Could not load file or assembly 'InfoStrat.VE, Version=, Culture=neutral, PublicKeyToken=a464bcc72081fceb' or one of its dependencies."

Thx b4...