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 poss开发者_运维百科ible?
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.
精彩评论