RadMenuItem HotKey Not Firing Command

2 posts, 0 answers
  1. Barry
    Barry avatar
    2 posts
    Member since:
    Jan 2017

    Posted 03 Nov Link to this post

    The snippet below is from an application for a machine shop which has a rather utilitarian menu.... I've been asked to add hot keys to some of the items; one of the menu items (as seen in the code below) I need to add the F6 key as a hotkey (note the idendical Command for clicking vs hotkey)...   clicking on it works as desired, but the hotkey has seemingly no effect whatsoever.

     

    What am I missing, or otherwise doing wrong? Thanks in advance for your help.

     

            <telerik:RadMenuItem Name="ToolsMenu" Header="Tools">
                <telerik:RadMenuItem Name="ToolsUseFinishLocationMenuItem" Header="Use Finish Location For Bin" Command="{Binding ToolsUseFinishLocationForBinCommand}" InputGestureText="F6">
                    <telerik:RadMenuItem.InputBindings>
                        <KeyBinding Key="F6" Command="{Binding ToolsUseFinishLocationForBinCommand}" />
                    </telerik:RadMenuItem.InputBindings>
                </telerik:RadMenuItem>
            </telerik:RadMenuItem>

  2. Dilyan Traykov
    Admin
    Dilyan Traykov avatar
    634 posts

    Posted 08 Nov Link to this post

    Hello Barry,

    The reason for this issue has been described in the following thread. Using the InputBindingBehavior suggested there, you can define your RadMenu like so:

    <telerik:RadMenu local:InputBindingBehavior.PropagateInputBindingsToWindow="True">
        <telerik:RadMenu.InputBindings>
            <KeyBinding Key="F6" Command="{Binding ToolsUseFinishLocationForBinCommand}" />
        </telerik:RadMenu.InputBindings>
        <telerik:RadMenuItem Name="ToolsMenu" Header="Tools" >
            <telerik:RadMenuItem Name="ToolsUseFinishLocationMenuItem" Header="Use Finish Location For Bin" Command="{Binding ToolsUseFinishLocationForBinCommand}" InputGestureText="F6" />
        </telerik:RadMenuItem>
    </telerik:RadMenu>

    Please let me know if this works for you.

    Regards,
    Dilyan Traykov
    Progress Telerik
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Back to Top