2

There are a lot of questions about virtual desktop feature in Win 10, but the answers are not satisfying. When I develop a Windows 10 App with UWP, c# and XAML I can't find a way to use this feature. What I like to achieve is the same behaviour that a typical Win 10 App shows, let's say: like Edge. If you open Edge on virtual desktop A, switch to desktop B and start Edge from there, it automagically switches back to desktop A and shows the Edge window. How can this be done with: VS 2015, UWP App, c#??

EDIT: maybe it has to do with single instance applications. But what I am looking for is answers to the following questions: - how many virtual desktops are there? - on which virtual desktop is my own App? - how can I move my App to a different virtual desktop?

Regards Heiko

okieh
  • 617
  • 6
  • 17
  • possible duplicate of [What is the correct way to create a single instance application?](http://stackoverflow.com/questions/19147/what-is-the-correct-way-to-create-a-single-instance-application) – BugFinder Aug 17 '15 at 10:49
  • 2
    @BugFinder, no, it's a completely different question. – Justin XL Aug 17 '15 at 10:51
  • 1
    But it also covers how to bring the other instance to the front.. I dont have win10 to check but Id imagine bringing focus to the old instance brings the desktop over - or at least you can work from there. – BugFinder Aug 17 '15 at 10:54
  • 2
    @BugFinder, that link is for Win32 and this is WinRT for UWP. Totally different APIs. – Justin XL Aug 17 '15 at 14:05

1 Answers1

6

Universal Windows apps are by nature single instance and get the behavior you ask for by default:

Create a new Universal Windows from the blank template.

  1. Run the app
  2. Add a new desktop & switch to it
  3. Run the app and you'll automatically switch back to the first instance on the original desktop.

Universal Windows apps cannot directly query or interact with the virtual desktops.

Classic Win32 apps can interact with virtual desktops and move windows between desktops via the VirtualDesktopManager and the IVirtualDesktopManager interface.

Rob Caplan - MSFT
  • 21,714
  • 3
  • 32
  • 54