We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

InputGestureText doesn't work

InputGestureText doesn't work!
No documentation, demo or any other information available, please help!

<syncfusion:MenuItemAdv
                    Command="{Binding OpenDocumentCommand}"
                    Header="{x:Static res:Strings.MenuFileOpenDocument}"
                    InputGestureText="Ctrl+O" />

Note that I did try to set some input binding on the UserControl as shown below but it still doesn't work.

     <UserControl.InputBindings>
        <KeyBinding Command="{Binding OpenDocumentCommand}" Gesture="Ctrl+O" />
    </UserControl.InputBindings>

Any idea, hint, solution, beer accepted :-)

4 Replies

TB Thirupathi Bala Krishnan Syncfusion Team November 28, 2019 01:52 PM UTC

Hi Jean-Marc,

Thanks for contacting Syncfusion support.

We have analyzed the reported query - "GestureText doesn't work in the MenuAdv control". Based on your requirement we will prepare a sample and then check the GestureText property by debugging our source project. So we will update the further details on 29th November, 2019.

We appreciate your patience until then.

Regards,
Thirupathi B.



TB Thirupathi Bala Krishnan Syncfusion Team November 29, 2019 12:43 PM UTC

Hi Jean-Marc, 
 
We have prepared a simple sample based on your requirement – “How to achieve the GestureText support in MenuAdv control”. This requirement can be achieved by making changes to the application level below the code. Please refer the following code sample. 
 
# MainWindow.xaml 
 
    <Window.InputBindings> 
        <KeyBinding Command="{Binding Command}" Key ="{Binding Command.Gesture.Key}" Modifiers="{Binding Command.Gesture.Modifiers}"></KeyBinding> 
    </Window.InputBindings> 
 
    <Grid> 
        <syncfusion:MenuAdv x:Name="menu" HorizontalAlignment="Left" Height="72" VerticalAlignment="Top" Width="206"> 
           <syncfusion:MenuItemAdv Header="_Edit" > 
                <syncfusion:MenuItemAdv InputGestureText="{Binding Command.GestureText}" Header="{Binding Command.Text}"/> 
            </syncfusion:MenuItemAdv> 
        </syncfusion:MenuAdv> 
    </Grid> 
 
# MainWindow.xaml.cs 
 
    public partial class MainWindow : Window 
    { 
        public ICommand Command { get; set; } 
 
        public MainWindow() 
        { 
            InitializeComponent(); 
            this.DataContext = this; 
            Command = new CommandWithHotkey("Cut", Key.X, ModifierKeys.Control); 
        } 
     } 
 
    public class CommandWithHotkey : ICommand 
    { 
        public CommandWithHotkey(string text, Key key, ModifierKeys modifier) 
        { 
            Text = text; 
            Gesture = new KeyGesture(key, modifier); 
        } 
 
        public bool CanExecute(object parameter) 
        { 
            return true; 
        } 
 
        public void Execute(object parameter) 
        { 
            MessageBox.Show("MenuItem Clicked : " + Text); 
        } 
 
        public KeyGesture Gesture { get; set; } 
 
        public string GestureText 
        { 
            get { return Gesture.GetDisplayStringForCulture(CultureInfo.CurrentUICulture); } 
        } 
 
        public string Text { get; set; } 
 
        public event EventHandler CanExecuteChanged; 
 
    } 
 
 
Sample link: https://www.syncfusion.com/downloads/support/forum/149502/ze/MenuAdvDemo-368794905

We have faced the issue while using mnemonics ‘Unable to access the menu items through the Mnemonics key” and we have logged an issue report for the same. We will provide the patch file for the reported issue on 13th December, 2019. The fix will be available in our next main release Volume 4 release which is scheduled to be rolled out at mid-December, 2019.

You can track the status of this report through the following feedback link, 
 
 

If you have any more specification replication procedure or a scenario to be tested you can add it as a comment in the portal.
 
 
Please let us know if you need any further assistance. 
 
Regards,
Thirupathi B.
 
 



JE Jean-Marc November 29, 2019 03:56 PM UTC

Thanks, got it to work!


VR Vijayalakshmi Roopkumar Syncfusion Team December 2, 2019 08:33 AM UTC

Hi Jean,

We are glad to hear that our solution meets your requirement.

Please let us know if you need any other assistance on this.

Regards
Vijayalakshmi V.R.


Loader.
Live Chat Icon For mobile
Up arrow icon