views:

60

answers:

1

I am very new to WPF and am trying to set up an application that requires switching of views.

For example, a user is viewing a system that contains a number of components, when they click on a component, it should switch to a view that is associated to that component, replacing the previous system view. It's my understanding a Controller should be used here but the implementation eludes me.

I have found a few examples, but the projects are a bit too large for me to actually follow what is going on specifically with the view switching. What would really help me here is some example code from the Unity setup in the App file that allows multiple views, the Code in the controller that switches the view, and the code associated with a button that makes the controller switch the view.

Thanks

A: 

If you are just beginning with WPF and diving directly into using IoC/MVVM, then you may want to consider taking a step back and starting with the WPF fundamentals, i.e., layouts, routed events, commanding, binding, dependency properties, INotifyPropertyChanged, etc...

To get you started: tutorials on wpf and mvvm.

For most of us mere mortals, WPF has a steep learning curve. Yet, once you make it over that first hump, the 'aha moments' start kicking in on a regular basis.

Metro Smurf
I actually have a few pages working quite well. I am currently switching views using a shell that just switches between different user controls within it but I feel like this will end up causing problems in the long run and I haven't really seen this method used in other examples. The controller that takes care of this is where I am really struggling. I also have a good knowledge of the project because I am converting a preexisting asp.NET website into a wpf desktop app so a lot of the back end is already done.
Justin