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:
-
Make a
dependency propertyin your window / top-level control, Which you can turn off, likeIsShowingKeyTips. Hold the keyboard input to flip it as if you consider it right. -
Create a
ContentControlwhich has two dependency properties such as 1)IsShowingKeyTipand 2)kitip text. Let's call thisPest Content Control. -
Edit
ContentControl 's ControlTemplate, to see how you want it. Make it acanvasor your favorite layout container, use some binding sizes properly, maybe put in some negativemarginsvalues. -
If you want to visualize, then some
attached propertysuch asKeyTip.Textis passed from plain control toKeyTipContentControl. -
In your XML, place
ContentControlsaroundcontrol. 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
Post a Comment