开发者

How to implement WPF Ribbon Contextual Tabs MVVM way

开发者 https://www.devze.com 2023-03-15 16:40 出处:网络
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 stor

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 Styles or even ControlTemplates for the various RibbonTabs in your App.config, avoiding the need to put that markup in the MainWindow. Then simply add all the RibbonTabs 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消