开发者

Using Ribbon control with PRISM

开发者 https://www.devze.com 2023-04-07 00:46 出处:网络
I want to create a composite wpf application with ribbon control using Prism, and I have some thoughts about commanding:

I want to create a composite wpf application with ribbon control using Prism, and I have some thoughts about commanding:

The ribbon tab is in different view, so i guess it will have开发者_运维技巧 specific view model. but the command should be in another view model, because when I click on button in the ribbon, I want to do some action in the view below, so how can I bind it? should I use Event Aggregator to communicate between the view models? maybe Composite command? any other approch?

Thanks.


Because it's a different Views/ViewsModels - EventAggregator is a way to go. You use command on a View with ribbon that executes Method on RibbonViewModel which will Publish that event. Other views subscribe to that event.

If you use Ribbon as a menu - then maybe you should use PRISM's Navigation to open other views (in different region)


This is the typical scenario for composite commands

0

精彩评论

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

关注公众号