简体   繁体   中英

Seeking guidance on WPF Prism Multi display application

I'm in the beginning stages of designing an application using Prism and have a question. In all the reference material I've been able to find, there is lots of details on creating a single screen application, but I have a requirements beyond that.

I would like the have two windows showing (Multi screen), both with the exact same layout but each looking at a difference source of information for their data. In other words, I have datasource A and datasource B that update very frequently and I need to monitor both of them at the same time.

Is there a way to launch a prism app multiscreen in this manner or would it better to launch separate processes for each source?

Thanks.

This should be pretty simple. Launching a new Window for each ought to do what you need (the user would have to move the window to the second monitor... I suppose you could investigate some p/invoke magic to move the window to the proper monitor if you wanted).

Do you need something more complicated?

If it's the same view with different data, I'd use MVVM and spin them off sort of like this:

MyFirstViewModel vm1 = new MyFirstViewModel();
MySecondViewModel vm2 = new MySecondViewModel();

MyView view1 = new MyView();
view1.DataContext = vm1;

MyView view2 = new MyView(vm2);
view2.DataContext = vm2;

view1.Show();
view2.Show();

Hopefully your view models can be reusable too so you wouldn't need to write a class for each, but hopefully this illustrates the strategy a little.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM