KeyGesture in screen tip

Ribbon for WPF Forum

Posted 8 years ago by Robert Croshere
Version: 10.2.0533
Avatar
Hi,

No matter what I do, I can't get the screentip of a ribbon:button to display the input gesture related to that button. Note that I am using the button as a standalone control, not on a ribbon. If I set a KeyBinding in the containing window's InputBinding's collection to the same command the button uses it doesn't show up. Even if I set the InputGestureText property of the button explicitly still nothing shows up in the screen tip. How do I get this to work?

Regards,
Robert

Comments (4)

Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Robert,

If I put this in a ribbon:
<ribbon:Button Label="Test" Command="ApplicationCommands.Open" />
I do see "Test (Ctrl+O)" in the screen tip that displays.

As long as the ScreenTipService.CanDeriveKeyboardShortcutFromCommand attached property is true on the button, it will look at the button's command and will search in the command's InputGestures collection for a KeyGesture. If found, it displays that.

FYI, the InputGestureText seems to just be for menu items at this time.


Actipro Software Support

Posted 8 years ago by Robert Croshere
Avatar
I think the problem is that I am using a DelegateCommand from the Prism library, not a RoutedCommand. Delegate commands don't have an InputGestures property, so that's probably the reason the gesture can't be found. I wire up the shortcut by using the input bindings of the window the command is used in:

<Window.InputBindings>
    <KeyBinding
        Command="{Binding MyCommand}"
        Gesture="F7" />
</Window.InputBindings>
Any ideas on how to get it to work in this case?
Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Robert,

We've updated buttons to show InputGestureText in their screen tips for the next maintenance release.

In the meantime, the only workaround is to put the shortcut in the screentip header property until this is updated.


Actipro Software Support

Posted 8 years ago by Robert Croshere
Avatar
Ok, thanks for adding that. I must say, I am impressed with your guys level of support with such things.

Regards,
Robert
The latest build of this product (v2018.1 build 0675) 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.