Changing a menu depending on the view

Jun 16, 2009 at 3:39 AM
Edited Jun 16, 2009 at 12:56 PM

I'm normally aa ASP.NET developer, but i have had a wpf proj thrown at me so i am pretty new at this.  I chose MVVM pattern because it looks like a good method for seperating concerns, however i am running into some features i can't seem to get my arms around.  The app looks like this:  it is 1 window, starts up a view which currently has the <Menu/> defined in the XAML (Exit commands etc..)  Clicking a button fires the ICommand which toggles visiblilty on another view (not even sure if thats the correct way to go between views), but what i would like is the second view adds another menuitem to the first view. 

Maybe some code would help:


<MenuItem Command="{Binding ExitCommand}" Header="Exit"/>
DataContext="{Binding MyControlDataContext}"
IsActive="{Binding IsActive}"
IsActive is a DependencyProperty which when changed fires off a storyboard to make it visible.  When it becomes visible I would like to add to the menu items.
Does that make any sense?  If not, i can try and explain further.


Thank you for any help