Zoinky
Zoinky

Reputation: 5019

Windows Forms or WPF for Multiple Monitor app (each monitor getting different content)

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

Upvotes: 0

Views: 209

Answers (1)

kidshaw
kidshaw

Reputation: 3451

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.

Upvotes: 1

Related Questions