ApplicationMenu Footer Buttons and Commands

Ribbon for WPF Forum

Posted 12 years ago by Scott Favre
Version: 1.0.0347
Avatar
I'm seeing some very odd behavior with buttons in the application menu footer. When I register for the Click event, the buttons work fine. However, when I try to use a command, the button is enabled, but nothing happens in response to the click.

Here is the relevant code:

Creating the command:
cmdExitApplication = new RibbonCommand(
    CommandNames.ApplicationExit,
    typeof(Ribbon),
    "Exit");
Creating the command binding:
CommandBinding cbndExitApplication = new CommandBinding(
                Commands.ExitApplication,
                OnExitApplication);
this.CommandBindings.Add(cbndExitApplication);
In the XAML:

<ribbon:ApplicationMenu>
  <!-- this button works -->
  <ribbon:Button Command="{x:Static commands:Commands.ExitApplication}"/>
          
  <ribbon:ApplicationMenu.FooterButtons>
    <!-- this button works -->
    <ribbon:Button Click="OnButtonClick"/>

    <!-- this is enabled, but nothing happens when it is clicked -->
    <ribbon:Button Command="{x:Static commands:Commands.ExitApplication}"/>
  </ribbon:ApplicationMenu.FooterButtons>
</ribbon:ApplicationMenu>
I've compared my code to the sample application closely, and as far as I can tell, I am not doing anything different. Any suggestions as to how I can get the footer buttons to work?

Thanks for your help

Scott Favre

Comments (2)

Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Scott,

That is odd since it all is working ok in the sample.

It sounds like the command isn't being routed properly for some reason. So perhaps your command binding isn't located in the chain of where it needs to be to be handled? One thing you could do is try setting the CommandTarget on the Button.

If none of that helps, then please email us a small sample project that shows this. Thanks!


Actipro Software Support

Posted 12 years ago by Scott Favre
Avatar
Thanks. Setting the CommandTarget fixes the problem.
The latest build of this product (v2019.1 build 0683) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.