I am building a composite WPF application with Prism and using the Ribbon Library. One thing I am having a very difficult time with is with region-crossing commands.
For example, I have my ribbon in my 'RibbonRegion' and a grid view in my 'MainRegion'. Lets say I want a button in my ribbon to pop up a message box with the currently selected item in the grid view, how do I do this?
The easy way is using EventAggregator but I fear that if I have a bunch of subscribers hooked up just for button clicks I am just asking for memory leak issues.
Is there a way to have a cross-region command, so that clicking a button in my 'RibbonRegion' will get the selected item in the grid view and pop up a message box with that value?
You can use a
System.Windows.Input.RoutedUICommand
First you need to declare your Command as below:
Then in your RibbonRegion xaml:
Then in your MainRegion xaml:
Then in your xaml.cs: