Template 10 Multiple Windows

2019-02-20 01:25发布

问题:

I'm currently exploring how to use Template 10, and would like to have two windows. One window is for moderation of photos, while the other will show the pictures to guests at an event.

So far, I've seen Microsoft MultiViews sample but it seems that it does not use Template 10.

Could someone point me/advice in a direction to be able to MultiViews using Template 10, or should I just abandon Template 10 altogether?

回答1:

You could use ProjectionManager for this. There's also a useful sample on MSDN. It basically allows you to open a secondary "window" just like PowerPoint does in the "presenter's view" if you have an extended desktop set up in Windows.

The secondary window then requires its own Frame and runs in a separate UI thread. This makes communication between your primary and secondary window a bit more difficult as you have to switch threads. The best way to communicate is to use something like an PubSubEvents of Prism (or any other framework).

I don't think Template10 supports this, but I wouldn't abandon it because of that. I'm not aware of any framework that does this out of the box, so you have to piece it together yourself.