0

I will be building an app that will be full screen on all available monitors. For each monitor available I will load up different content. So if the system has detected 2 monitors, I will generate 2 windows each window with different content (they will be full screen, taking over everything including taskbar, etc)

Is windows forms best suited for this or wpf. Also in the display settings, I assume each additional monitor should be setup as "extending desktop" who will i get the right working area.?

Windows form provides the Screen class but when i run it on a monitor with 1920x1080, i get

Device Name: \\.\DISPLAY1
Bounds: {X=0,Y=0,Width=1280,Height=720}
Type: System.Windows.Forms.Screen
Working Area: {X=0,Y=0,Width=1280,Height=693}
Primary Screen: True
Zoinky
  • 4,083
  • 11
  • 40
  • 78
  • Forget winforms. It's not recommended for any new projects, regardless of project requirements. There is absolutely nothing you can achieve with winforms that can't be achieved in WPF even easier and better. – Federico Berasategui Aug 23 '14 at 05:23
  • all examples I have seen for multiple monitor support require the use of system.windows.forms dll in wpf projects – Zoinky Aug 23 '14 at 05:25
  • that doesn't mean you will build the app using winforms. You might use that dll (which in fact wraps native Win32 stuff) or call the Win32 stuff directly bypassing it. You can even grab the source from RefenceSource and copy paste it on your own code. Or even use WPF's [`System.Windows.SystemParameters`](http://stackoverflow.com/a/13690313/643085). Regardless of all that, you should use WPF to build the actual UI. – Federico Berasategui Aug 23 '14 at 05:32

1 Answers1

1

WPF can easily support multiple windows simultaneously. If you subscribe to an MVVM pattern with them, you can interact between the two windows by either

  • binding both windows to the same instance of a view model, so the view model is shared between them. A button command fired in window A can update properties bound to the view in Window B and vice verse, to give a simple example.
  • implement a messaging platform, such as MVVM light off nuget. This allows each window to have its own view model but interact using decoupled messages. In the same example, window A issues a message when a button in pressed via its view model, window b's view model listens for that message and actions some update.

If you're skill set includes, or you have time to learn, WPF - go with that option.

This stack overflow answer will help with controlling your windows launch state via the WindowLoad event, using the frameworks Screen collection.

Community
  • 1
  • 1
kidshaw
  • 3,423
  • 2
  • 16
  • 28