Click here to Skip to main content
14,490,828 members
Rate this:
Please Sign up or sign in to vote.
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.



1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

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.

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

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100