C1MenuItem InputGestureText property

Posted by: stefan.nerlich on 23 November 2017, 8:06 pm EST

    • Post Options:
    • Link

    Posted 23 November 2017, 8:06 pm EST

    Hi everyone,

    How can i databind a keyboard shortcut text (e.g Ctrl+O) to C1MenuItem similar to the default WPF MenuItem Property “InputGestureText”

    
    <c1:C1Menu ItemsSource="{Binding MenItemList, Mode=TwoWay}"
                       c1:C1DockPanel.Dock="Top" AutoClose="True" DetectBoundaries="True">
                <c1:C1Menu.ItemTemplate>
                    <c1:C1HierarchicalDataTemplate DataType="{x:Type cmnVM:MenuItemViewModel}" ItemsSource="{Binding Path=MenItemList}">
                        <TextBlock Text="{Binding Header}" />
                    </c1:C1HierarchicalDataTemplate>
                </c1:C1Menu.ItemTemplate>
                <c1:C1Menu.ItemContainerStyle>
                    <Style TargetType="{x:Type c1:C1MenuItem}">
                        <Setter Property="Command" Value="{Binding Command}" />
                        <Setter Property="IsEnabled" Value="{Binding IsEnabled}"/>
                        <Setter Property="IsCheckable" Value="{Binding IsCheckable}"/>
                        <Setter Property="IsChecked" Value="{Binding IsChecked}"/>
                    </Style>
                </c1:C1Menu.ItemContainerStyle>
            </c1:C1Menu>
    
    
  • Posted 26 November 2017, 11:33 pm EST

    Hi,

    There is no built-in property to set shortcut/hotkeys directly for C1MenuItem that can help us navigate through the menu using the keyboard itself.

    However, you can try with the below implementation.

    https://www.grapecity.com/en/blogs/hotkeys-in-c1menu-for-wpf

    Thanks,

    Singh

  • Posted 27 November 2017, 12:23 am EST

    Thank you for your quick response. I was already aware of the sample project you mentioned in your answer but my question relates to the “InputGestureText” and how to bind this text in the C1MenuItem to achieve a comparable result in the attached screenshot

  • Posted 27 November 2017, 4:10 pm EST

    Hi,

    I forwarded your requirement to concern team as an enhancement.

    Will be added in the future build if it founds it’s feasible.

    (TFS ID: 298639 for internal use only)

    Thanks,

    Singh

  • Posted 22 August 2018, 8:33 pm EST

    Hi,

    In the latest build, the InputGestureText property has been added to C1MenuItem. This build can be downloaded from the link below:

    http://prerelease.componentone.com/dotnet40/C1WPFLibrary/2018-T2/C1WPFBasicLibrary.4_4.0.20182.595.zip

    You can update to 2018 v2 build using C1Live.

    Thanks,

    Pragati

  • Posted 14 November 2018, 2:24 am EST

    Thank you! The InputGestureText property works as exptected.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels