简体   繁体   English

在PRISM中使用功能区控制

[英]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: 我想使用Prism创建一个具有功能区控制的复合wpf应用程序,并且对命令有一些想法:

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? 我应该使用Event Aggregator在视图模型之间进行通信吗? maybe Composite command? 也许复合命令? any other approch? 还有其他办法吗?

Thanks. 谢谢。

Because it's a different Views/ViewsModels - EventAggregator is a way to go. 因为它是不同的Views / ViewsModels-EventAggregator是一种解决方法。 You use command on a View with ribbon that executes Method on RibbonViewModel which will Publish that event. 您可以在具有功能区的视图上使用命令,该命令在RibbonViewModel上执行Method,它将发布该事件。 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) 如果您使用功能区作为菜单-那么也许应该使用PRISM的导航来打开其他视图(在不同区域)

这是复合命令的典型方案

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 WPF应用程序的棱镜区域,顶部具有功能区控制 - Prism regions for WPF application with Ribbon control on top Office 功能区:使用 XML 创建功能区时如何访问控件 - Office Ribbon: How to access a control when the ribbon was created using XML 使用VSTO在Outlook中访问功能区中的控件 - Accessing control inside a ribbon in Outlook using VSTO Prism 7、WPF (.NetCore)、DevExpress 和功能区 - 集成 - Prism 7, WPF (.NetCore), DevExpress and ribbon - integration 更改功能区button_click事件中的图像以使用C#进行Outlook功能区按钮控件? - Change a Image in ribbon button_click event for outlook ribbon button control using c#? 如何使用棱镜6处理WPF中的Grid Control中的TextBlock单击? - How to handle the TextBlock Click within the Grid Control in WPF using prism 6? 使用Prism时,如何允许WPF为Window控件解析ContentTemplate? - How to allow WPF to resolve ContentTemplate for a Window control when using Prism? 使用带有框架控件的Prism NavigationService赢得通用应用程序 - Win universal app using Prism NavigationService with Frame control Microsoft PRISM:在WPF菜单控件中使用多个区域 - Microsoft PRISM: Using multiple regions in a WPF Menu control Prism 7. 将 PrismApplication.CreateShell() 与非 Window 控件一起使用 - Prism 7. Using PrismApplication.CreateShell() with a non Window control
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM