Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8394501
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:04:43+00:00 2026-06-09T20:04:43+00:00

I am building a composite WPF application with Prism and using the Ribbon Library.

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T20:04:44+00:00Added an answer on June 9, 2026 at 8:04 pm

    You can use a System.Windows.Input.RoutedUICommand

    First you need to declare your Command as below:

    public static class Commands
    {
        public static readonly RoutedUICommand TestCommand = new RoutedUICommand("Test Command",
            "Test Command", typeof(Commands));
    }
    

    Then in your RibbonRegion xaml:

    <my:RibbonButton Command="{x:Static cmd:Commands.TestCommand}" ...
    

    Then in your MainRegion xaml:

    <UserControl.CommandBindings>
        <CommandBinding CanExecute="OnTestCanExecute"
                        Command="{x:Static cmd:Commands.TestCommand}"
                        Executed="OnTestExecute" />
    </UserControl.CommandBindings>
    

    Then in your xaml.cs:

    public void OnTestRouteCanExecute(object sender, System.Windows.Input.CanExecuteRoutedEventArgs e)
        {
            e.CanExecute = true;
        }
    
        public void OnTestRouteExecute(object sender, System.Windows.Input.ExecutedRoutedEventArgs e)
        {
            // do some stuff here
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am building a composite application using CAL/Prism. The main region is a tab
Im building a wpf app with the composite application block (prism) V2, and Im
I'm building an application which uses Ruby+RMagick to composite PNG images onto various JPEG
I am building a database system and having trouble with the design of one
I am using Ivy to assemble a composite application from internally developed and third
is there anyway for DelegateCommand's to support gestures when building a composite WPF app?
Building an application, before using a real database, just to get things work I
Using GWT 2.4... I am building upon a complex Composite dual view/edit mode implementation
I'm building a composite control that uses the telerik ajax controls as it's inputs,
I'm building a login form composite component. The page that uses it will pass

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.