One WPF Window/View Controller with multiple views

In a WPF window I will have buttons on the top and then content below.

In the content section (buttons always stay there) I want to have maybe a "view" with some text boxes and then some other "view" with a datagrid.  These "views" I want to have their own code behind class.

On the click of a button I want to be able to add the new "view" and maybe animate a little bit the removal of the old "view"

Dont get to caught up in the animate part.

The thing I want to know is what is the Object/element which can contain these multiple views?
How can I create my "views" with code behind?
How can I add then a new view and dispose of the old view so that views are not kept in memory?

I am a VB'er but if you must do it in C# then go for it.

Thanks all for your help.
LVL 20
darbid73Asked:
Who is Participating?
 
darbid73Author Commented:
What I am looking for has not much to do with "navigation" such as what Internet Explorer does.  As such navigation might be a bad word to use.

Basically I am looking for a beginner's answer.

The thing I want to know is what is the Object/element which can contain these multiple views?
Basically any of the WPF objects that can have 1 to n children will work.  Eg a Grid.
How can I create my "views" with code behind?
Create a UserControl and add whatever objects you want to this.  Use the generated Code behind file for this User Control.
How can I add then a new view and dispose of the old view so that views are not kept in memory?
 This UserControl can then be added and removed from for example a Grid by simply adding a child and then removing an old child.
0
 
apeterCommented:
Hope below link helps. You can have Grid with two rows, first row has your buttons and second row has ur Frame control instead of Dockpanel

http://www.paulstovell.com/wpf-navigation
0
 
darbid73Author Commented:
I think this is the best solution to my question.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.