Key Tips in WPF -


Office 2007 and the Ribbon introduced the concept of "".

In short, a command in each ribbon receives a letter which you can press to activate that command. ... the letters are indicated by the small "kitips" which indicate the letter to press control to activate. KeyTips are displayed using the Alt key, so use them how menu navigation works in windows

(source :)

One of the main tips The example can be shown as follows. In this diagram, the ALT key is pressed, and waiting for further input.

Are there any WPF open source examples of "key tips"?

How can you go about applying something like this feature in a normal way (i.e. no ribbon required)? How you implement it using the MVVM pattern (ICMM does not support inputbinding).

Note: Actifo has implemented this feature in its implementation, but they have not released the source code.

First of all, you can see in Microsoft WPF Toolkit. Or, a general approach would be like this:

  1. Make a dependency property in your window / top-level control, Which you can turn off, like IsShowingKeyTips . Hold the keyboard input to flip it as if you consider it right.

  2. Create a ContentControl which has two dependency properties such as 1) IsShowingKeyTip and 2) kitip text . Let's call this Pest Content Control .

  3. Edit ContentControl 's ControlTemplate , to see how you want it. Make it a canvas or your favorite layout container, use some binding sizes properly, maybe put in some negative margins values.

  4. If you want to visualize, then some attached property such as KeyTip.Text is passed from plain control to KeyTipContentControl .

  5. In your XML, place ContentControls around control . Set binding as appropriate.

You will end up with something at the top level like this:

  & lt; window .. . & Gt; & Lt; Code: KeyTipContentControl KeyTipText = "A" IsShowingKeyTip = "{Binding IsShowingKeyTips}" & gt; & Lt; Button x: name = "MyButtonWithKeyTip" ... /> & Lt; / Code: KeyTipContentControl & gt; & Lt; / Window & gt;  

I am not yet ready to handle the major press in an elegant fashion: -)


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -