开发者

Using Ribbon control with PRISM

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜