RibbonContextMenue

Ribbon for WPF Forum

Posted 12 years ago by MichaelEhlert - Boll und Partner Software GmbH
Avatar
Hi everybody,
i have a custom command assigned with

InputGestureCollection igc = new InputGestureCollection();
igc.Add(new KeyGesture(Key.P, ModifierKeys.Control | ModifierKeys.Shift));
applicationPrintSelect = new RibbonCommand("ApplicationPrintSelect", typeof(Ribbon), "PrintSelect", null, "/Images2/Print32.png", "Auswahl anzeigen", igc);

The screen tip shows Ctrl+Shift+P as keyboard shortcut instead of Strg+Umsch+P (the German key description). Input gestures for ApplicationCommands are shown in the language specific description. Anything i can do?

Michael

Comments (8)

Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Michael,

Right now, the code to build the shortcut is this:
((KeyGesture)inputGesture).GetDisplayStringForCulture(System.Globalization.CultureInfo.CurrentCulture)
Is that incorrect?


Actipro Software Support

Posted 12 years ago by MichaelEhlert - Boll und Partner Software GmbH
Avatar
Hi,

seems to be correct. I checked the currentCultrue (de-DE for my system), seems to be correct either. Anyway, the statement returns Ctrl+...

Well, it is not a real problem - just a little bit confusing as i get "Strg+P" for Application.Print and "Ctrl+Shift+P" for my user command.

Michael
Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
I reflected on Microsoft's MenuItem code and they do the same thing:
gesture.GetDisplayStringForCulture(CultureInfo.CurrentCulture);
So I'm not quite sure what the problem could be here. Could you try manually calling that code on your KeyGesture to see if you get the English or German version? I'm interested in your results.


Actipro Software Support

Posted 12 years ago by MichaelEhlert - Boll und Partner Software GmbH
Avatar
Hi,
i checked the GetDisplayStringForCulture call for my key gestures. CultureInfo.currentculture is set to de-de, but the returned string always contains the English description. ApplicationCommands (where i don't set an explicit key gesture as they already have one) display the right description (like Strg+P for Application.Print). Well, seems to be a MS-Bug?!

Michael
Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Michael,

Since you can duplicate both ways, can you post in the Microsoft WPF forum on this so we can see what their response is:
http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=119&SiteID=1


Actipro Software Support

Posted 12 years ago by MichaelEhlert - Boll und Partner Software GmbH
Avatar
Well, posted the subject to MS. Meanwhile, as workarround, i set the keygesture display upon creation of the gesture (third parm of new KeyGesture overload). The text is then displayed as desired on Ribbon ScreenTips.

Michael
Posted 12 years ago by MichaelEhlert - Boll und Partner Software GmbH
Avatar
Hi,
here's an answer from the MS Forum:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1783252&SiteID=1

Michael
Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Thanks for the reply.


Actipro Software Support

The latest build of this product (v2019.1 build 0683) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.