WPF desktop application with multiple views

1.3k views Asked by At

I have a WPF application running on Windows 8. It is the one-window application that has three different views in the whole client area of the main window: live video from a webcam, help screen, and resource usage status. As you can see they are not related or interact each other, but I want to show them in one window rather than poping up a new window. The views will be switched by clicking a button in each view or by typing a keyboard shortcut.

I'm currently implementing each view using UserControl, and then adding/removing those UserControls in the grid of MainWindow on user events. I'm not sure if using the UserControl is the right direction because UserControl brings up the image of small widgets like buttons rather than a whole window content to me.

Am I doing correctly? I just looked at the Page control, but I'm not sure if it is a good idea. Thanks in advance!

2

There are 2 answers

0
Reed Copsey On BEST ANSWER

I'm currently implementing each view using UserControl, and then adding/removing those UserControls in the grid of MainWindow on user events. I'm not sure if using the UserControl is the right direction because UserControl brings up the image of small widgets like buttons rather than a whole window content to me.

There is nothing wrong with a UserControl providing the bulk (or all) of the content for a Window. In fact, this is fairly common when using frameworks, as the Window is created for you in some frameworks.

I would not worry about using a UserControl for this.

0
Joe Brunscheon On

Another popular way to implement multiple views on a single WPF window is to use a Tab Control and have each tab set to different user controls.

User Controls are definitely useful, and you have done something perfectly valid.