Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
Key binding is not working in xammenu


I am trying to bind the command to xamMenuitem in hirerchialdatatemplate. Mousebindings are working as expected but keybinding is not working. On enter key i am trying to trigger to my viewmodel. can you please help in this.

please find below snippet.

 <Popup x:Name="ProductsPopup" Height="Auto" Focusable="True" StaysOpen="False" Closed="ProductsPopup_OnClosed" >

<ig:XamMenu IsTextSearchEnabled="True" x:Name="xamNavigator" MenuOrientation="Vertical" Focusable="True"
Width="150" ExpandOnHover="True" IsTextSearchCaseSensitive="False" MinHeight="180" Selector.IsSelected="True"
ItemsSource="{Binding ProductTypes}">

<ig:HierarchicalDataTemplate ItemsSource="{Binding ProductVariantList}">

<Label Focusable="True" HorizontalAlignment="Left" HorizontalContentAlignment="Left" VerticalAlignment="Center" Foreground="White" Content="{Binding Path=ProductTypeName}">
<MouseBinding Command="{Binding ProductTypeSelectCommand}" MouseAction="LeftClick" />
<KeyBinding Command="{Binding ProductTypeSelectCommand}" Key="Enter"></KeyBinding>


<Label Focusable="True" HorizontalContentAlignment="Left" HorizontalAlignment="Left" VerticalAlignment="Center" Foreground="White" Content="{Binding Path=ProductVariantName}" >

<MouseBinding Command="{Binding ProductVariantSelectCommand}" MouseAction="LeftClick" />
<KeyBinding Command="{Binding ProductVariantSelectCommand}" Key="Enter"/>



No Data
  • 2180
    Offline posted

    Hello viswa,

    Thank you for contacting Infragistics Developer Support.

    In order the KeyBinding for the Enter key to work, you have to add the binding to the xamMenuItem instead of to the Label control.

    I’ve attached a sample project to demonstrate this.

    Let me know if I may be of further assistance.
No Data