views:

189

answers:

2

I am developing a WPF desktop app for a small business. It will have a dashboard with 4 buttons that should show a corresponding window/form.

Examples -

  1. Manage Entries
  2. Admin
  3. Reports
  4. Help

Each of these has a separate form with lots of controls and stuff.

Is it best to have each of these as a separate window (including dashboard) and show them when a button is clicked in the dashboard?

Or is it possible to have just one window with these 4 buttons on top, and swap the contents below depending on the button?

I am kind of new to WPF apps so I don't know whats possible and what is the best-practice.

+4  A: 

What you will find with WPF is nearly anything is possible from a UI perspective.

It is definitely possible having one window and swapping the contents below depending on the button. A pattern I like is PRISM which has some interesting patterns and best practices on achieving composite windows in both WPF and Silverlight.

You could also look at the MVVM pattern, which is becoming really popular with WPF. Josh Smith has many great articles for this.

Also, if you are really new, have a look as User Controls, as this allows you to easily modularize certain sections.

What I found with myself was with my first few WPF applications, I approached it from a Winform's mindset - but then after really getting a second look at Binding, these other patterns really began to shine.

Mark Pearl
+1 for the prism link
borisCallens
+1  A: 

One best-practice approach is to use Composite Application Guidance. Basically it is an application design approach which contains a shell and multiple views which are arranged inside it. Microsoft has released a CAG library called Prism through CodePlex, and has provided tutorials and documentation for it on MSDN.

CodePlex Link: Composite WPF and Silverlight

MSDN Link: Composite Client Application Guidance

Aviad P.