tags:

views:

289

answers:

1

Is there a simple way to cause a (full screen) WPF app to launch on a secondary display? I know I could get the entire virtual desktop rectangle and calculate an offset, but is there a more direct way?

+3  A: 

AFAIK there is currently no way to do this purely with WPF.

However you should be able to:

  • Use the System.Windows.Forms.Screen class to get information about the screen(s)

  • Reposition your window:

    Application.Current.MainWindow.Left = xxx;
    Application.Current.MainWindow.Top = yyy;

Koistya Navin
But accessing "System.Windows.Forms.Screen" will require adding Windows Forms related assemblies to WPF project and as a result will impact startup performance as well as memory footprint or the overall project.
Denis Vuyka