简体   繁体   中英

How to implement WPF Ribbon Contextual Tabs MVVM way

I'm developing MVVM application using WPF Ribbon control from Office UI licensing site as main menu. And I can not bind or somehow inject contextual tabs into my ribbon control. I do not want to store all contextual tabs markup and command bindings in my main view, I want to use this tabs depending on view selected and store this tabs maybe in same view or some special view with only this type of tabs. Is it possible?

One thing you could do is to write Style s or even ControlTemplate s for the various RibbonTab s in your App.config, avoiding the need to put that markup in the MainWindow . Then simply add all the RibbonTab s into the Ribbon in MainWindow.xaml and set the Visibility properties of each by binding to the main view model. You could use a load of bool properties in the main view model with a simple bool to Visibility converter.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM