Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
3.50/5 (2 votes)
Hey everyone!


I have a question regarding ribbon control and a wpf application that utilizes pages.

My initial design of this application was to utilizes pages within a frame to control content. I was hoping to use a ribbon to handle button functionality but am not sure how to bind values from the page to the parent window which contains the ribbon control.

Any advice or links to helpful material would be appreciated.


Thanks!

-Ethan
Posted

1 solution

As long as the DataContext for the page is the same, you do not have to worry about it. What I might do is have the specific datacontext (ViewModel) for page be a property on Frame, and all inherit from an interface that will let the buttons ICommand methods access the specific methods for the page ViewModel to perform the issues. You can actually create a IValueConverter that will specify the Page View for the Frame depending on the class of the property used for the DataContext of the Page. I wish I could find some example on the internet to show you how to do it. Guess I will have to create a tip on this.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900