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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

InputGestureText doesn't work

Thread ID:

Created:

Updated:

Platform:

Replies:

149502 Nov 27,2019 10:41 PM UTC Dec 2,2019 08:33 AM UTC WPF 4
loading
Tags: MenuAdv
Jean-Marc
Asked On November 27, 2019 10:41 PM UTC

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 :-)

Thirupathi Bala Krishnan [Syncfusion]
Replied On 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.


Thirupathi Bala Krishnan [Syncfusion]
Replied On 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.
 
 


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

Thanks, got it to work!

Vijayalakshmi Roopkumar [Syncfusion]
Replied On 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.


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon