none
Surface controls for Visual Studio 2012 and WPF under Net 4.5+ RRS feed

  • Question

  • I am using Visual Studio 2012, Update 3. I have been using Visual Basic and WPF. My application targets Microsoft .Net 4.5 and runs on the desktop.

    I want to adapt my program to run using touch on Windows 7 and Windows 8 computers.  I have done part of this work already, modifying my user controls to work well on a canvas with touch and mouse control.

    Now I want to modify the way I use some of the basic controls, and while I am doing that I want them to respond to touch. These are controls such as the ListBox and the Radio buttons.  The surface 2.0 controls looked like the perfect answer, however it appears see they are meant to be used with Windows 7 and Net 4, per the prerequisites on the Surface SDK download page.  Also, when I installed the Surface SDK, the templates for a Surface application were not installed into VB 2012.

    So is it true that there are no surface controls designed for VS 2012, Net 4.5 and WPF? If so, are there some under development at Microsoft? 

    If I have interpreted the lack of surface controls, then I would need to use the existing touch capabilities in the existing WPF controls to bring touch into my application.  Is this correct?  

    If am not sure this is the correct place to post this question.

    Ralph

    Friday, August 23, 2013 3:18 AM

Answers

  • Hi,

    >>So is it true that there are no surface controls designed for VS 2012, Net 4.5 and WPF? If so, are there some under development at Microsoft?

    For this question, i think the answer is true, we can try to use the following solution:

    It does expect us to have Visual Studio 2010 installed. Following the following steps I managed to compile in Visual Studio 2012 using .NET 4.5. TouchDown events work.

    1. Use Visual Studio 2010 to set up a Surface project.
    2. Safe and close Visual Studio 2010.
    3. Open the solution using Visual Studio 2012.
    4. Change the target framework under project settings to .NET 4.5.
    5. Save as a new solution file.
    6. Compile.

    This method prevents you from having to set up all the configuration files/references yourself. The only downside is you don't have any of the Surface tools integrated into the IDE.

    E.g. the toolbox, project templates, this of course doesn't prevent you from writing plain XAML yourself.


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    • Marked as answer by RCubed3 Monday, August 26, 2013 3:17 PM
    Monday, August 26, 2013 2:07 AM
    Moderator

All replies

  • Hi,

    >>So is it true that there are no surface controls designed for VS 2012, Net 4.5 and WPF? If so, are there some under development at Microsoft?

    For this question, i think the answer is true, we can try to use the following solution:

    It does expect us to have Visual Studio 2010 installed. Following the following steps I managed to compile in Visual Studio 2012 using .NET 4.5. TouchDown events work.

    1. Use Visual Studio 2010 to set up a Surface project.
    2. Safe and close Visual Studio 2010.
    3. Open the solution using Visual Studio 2012.
    4. Change the target framework under project settings to .NET 4.5.
    5. Save as a new solution file.
    6. Compile.

    This method prevents you from having to set up all the configuration files/references yourself. The only downside is you don't have any of the Surface tools integrated into the IDE.

    E.g. the toolbox, project templates, this of course doesn't prevent you from writing plain XAML yourself.


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    • Marked as answer by RCubed3 Monday, August 26, 2013 3:17 PM
    Monday, August 26, 2013 2:07 AM
    Moderator
  • Thank you for the innovative approach, Franklin!

    In my own testing, I was able to bring the surface controls into the toolbox in VS 2012 and from there bring them into my WPF forms.  Initially, it seemed to go well; the controls worked and the program compiled. However, each time I ran into trouble when testing how they responded.  They did not seem to work well with the traditional controls.  Also some of the traditional controls that I use do not have surface counterparts.  An example is the canvas control. Surface has in inkcanvas, but in reading its description it seems to be a tool meant for writing and drawing, which is not what I needed. I thought that if I could create a surface window to build on, that might help.

    I believe the approach you identified would allow me to get a surface window to build on within VS 2012, which is what I could not do before. 

    I certainly hope that a Surface 3 is in the works.  WPF provides great power. A Surface 3 for VS 2012 and WPF with a set an expanded set of controls would make it pop. 



    Ralph

    Monday, August 26, 2013 3:45 PM
  • The Surface 2.0 SDK is _THE_ way to build rich multi-touch applications.  Given the market place today, it is essential for any WPF application.  Any other approach will require you to re-invent much of what the Surface 2.0 SDK provides.  The ScatterView control alone might eat up a couple months of development time.  It's unlikely your implementation of a ScatterView like control would be as good as Microsoft's since the Surface SDK team was likely well advised by other WPF team members.

    It's worth remembering that the Surface 2.0 SDK was a technology pillar of what was once a Milestone product for Microsoft, the SUR40.

    You can get a lot of mileage from the Surface 2.0 SDK if you avoid using SurfaceWindow (because it introduces platform issues for versions of Windows higher than Windows 7).

    If you must use SufaceWindow, there's no free lunch.  You will have to slog to figure out how to make certain parts of the SDK work with Windows 8/10.  Do not expect Microsoft to help you.  All current similar Microsoft initiatives are focused on the WinRT Runtime and Surface HUB.  It's likely Microsoft wants the Surface 2.0 SDK to quietly go away.  .Net 4.5.2 broke aspects of the internals of the Surface 2.0 SDK.  It's left to you the ender user of the SDK to fix this little problem.  Good luck.

    Tuesday, November 24, 2015 9:45 PM