Represents a class that hosts all IKey instances, the infrastructure to create new keys, organizes them into logical rows and contains the logical layout implementation. This class also has several predefined layouts.
Definition
Namespace:Telerik.WinControls.VirtualKeyboard
Assembly:Telerik.WinControls.UI.dll
Syntax:
public class VirtualKeyboardLayout : BaseVirtualKeyboardLayout, IDisposable, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IStylableNode, IVirtualKeyboardLayout
Inheritance: objectDisposableObjectRadObjectRadElementBaseVirtualKeyboardLayoutVirtualKeyboardLayout...
Implements:
Inherited Members
Constructors
Initializes new instance of the VirtualKeyboardLayout class.
public VirtualKeyboardLayout()
Properties
Gets or sets the logical spacing between keys.
public double KeySpacing { get; set; }
Gets the logical rows collection.
public ObservableCollection<Row> Rows { get; }
Gets the total number of logical columns.
public override double TotalColumnsCount { get; }
Overrides:
Gets the total number of logical rows.
public override double TotalRowsCount { get; }
Overrides:
Methods
Adds an empty space to the rows and children of VirtualKeyboardLayout.
Adds a IKey instance to the rows and children of VirtualKeyboardLayout.
Adds a key to the rows and children of VirtualKeyboardLayout.
public virtual IKey AddKey(int virtualKeyCode, KeyType keyType, double width = 1, double height = 1, bool isSharpStyle = false, bool showSecondaryText = false)
The virtual key code.
keyTypeKeyTypeThe type of the key.
widthdoubleThe logical width of key.
heightdoubleThe logical height of key.
isSharpStyleboolIndicates whether the key has more noticeable(sharp) style.
showSecondaryTextboolIndicates whether to show the secondary text element.
Returns:The added key.
Adds a Key instance to the rows and children of VirtualKeyboardLayout.
Adds a key to the rows and children of VirtualKeyboardLayout.
public virtual IKey AddKey(Keys key, KeyType keyType, double width = 1, double height = 1, bool isSharpStyle = false, bool showSecondaryText = false)
The key.
keyTypeKeyTypeThe type of the key.
widthdoubleThe logical width of key.
heightdoubleThe logical height of key.
isSharpStyleboolIndicates whether the key has more noticeable(sharp) style.
showSecondaryTextboolIndicates whether to show the secondary text element.
Returns:The added key.
Adds a ToggleKey instance to the rows and children of VirtualKeyboardLayout.
Add a key to the VirtualKeyboardLayout.
protected virtual IKey AddKeyInternal(IKey key)
The key to be added.
Returns: Exceptions:If the key does not inherit from RadItem.
Adds a new line.
public virtual void AddNewLine()
Adds a numpad key to the rows and children of VirtualKeyboardLayout.
public virtual IKey AddNumpadKey(Keys numLockActiveKeyCode, string activeKeyText, Keys alternateKeyCode, string alternateKeyText, double width = 1, double height = 1, bool sharpStyle = false, Font activeKeyFont = null, Font alternateKeyFont = null)
The virtual key code of active state.
activeKeyTextstringThe text in active state.
alternateKeyCodeKeysThe virtual key code in alternate mode.
alternateKeyTextstringThe text in alternate state.
widthdoubleThe logical width of key.
heightdoubleThe logical height of key.
sharpStyleboolIndicates whether the key has more noticeable(sharp) style.
activeKeyFontFontThe font specified to the key element in active state.
alternateKeyFontFontThe font specified to the key element in alternate state.
Returns:The added key.
Adds a spacial key to the rows and children of VirtualKeyboardLayout.
public virtual IKey AddSpecialKey(int virtualKeyCode, string displayText, KeyType keyType, double width = 1, double height = 1, bool isSharpStyle = false, Font font = null)
The virtual key code.
displayTextstringThe display text.
keyTypeKeyTypeThe type of the key.
widthdoubleThe logical width of key.
heightdoubleThe logical height of key.
isSharpStyleboolIndicates whether the key has more noticeable(sharp) style.
fontFontThe font specified to the key element.
Returns:The added key.
Adds a special key to the rows and children of VirtualKeyboardLayout.
public virtual IKey AddSpecialKey(Keys key, string displayText, KeyType keyType, double width = 1, double height = 1, bool isSharpStyle = false, Font font = null)
The key.
displayTextstringThe display text.
keyTypeKeyTypeThe type of the key.
widthdoubleThe logical width of key.
heightdoubleThe logical height of key.
isSharpStyleboolIndicates whether the key has more noticeable(sharp) style.
fontFontThe font specified to the key element.
Returns:The added key.
Adds a toggle key to the rows and children of VirtualKeyboardLayout.
public virtual IKey AddToggleKey(int virtualKeyCode, string displayText, KeyType keyType, double width = 1, double height = 1, bool isSharpStyle = false)
The virtual key code.
displayTextstringThe display text.
keyTypeKeyTypeThe type of the key.
widthdoubleThe logical width of key.
heightdoubleThe logical height of key.
isSharpStyleboolIndicates whether the key has more noticeable(sharp) style.
Returns:The added key.
Adds a toggle key to the rows and children of VirtualKeyboardLayout.
public virtual IKey AddToggleKey(Keys key, string displayText, KeyType keyType, double width = 1, double height = 1, bool isSharpStyle = false)
The key.
displayTextstringThe display text.
keyTypeKeyTypeThe type of the key.
widthdoubleThe logical width of key.
heightdoubleThe logical height of key.
isSharpStyleboolIndicates whether the key has more noticeable(sharp) style.
Returns:The added key.
Arranges the VirtualKeyboardLayout to its final location. The element must call the Arrange method of each of its children.
protected override SizeF ArrangeOverride(SizeF finalSize)
The size that is available for element.
Returns:The rectangle occupied by the element. Usually finalSize. Should you return different size, the Layout system will restart measuring and rearranging the items. That could lead to infinite recursion.
Overrides:
In this method call to the Arrange method of each child must be made.
Creates a new instance of the VirtualKeyboardLayout class with added buttons for the default numpad keyboard group.
public static VirtualKeyboardLayout CreateDefaultNumpadLayout()
The created instance.
Creates a new instance of the VirtualKeyboardLayoutPanel class with added buttons for extended keyboard layout.
public static VirtualKeyboardLayoutPanel CreateExtendedKeyboardLayoutPanel(bool includeFunctionKeys = true)
A value indicating whether to include the function keys.
Returns:Creates a new instance of the VirtualKeyboardLayout class with added buttons for the function buttons keyboard group.
public static VirtualKeyboardLayout CreateFKeysLayout(bool addEscapeKey = true)
A value indicating whether to include the escape key.
Returns:The created instance.
Creates a new instance of the VirtualKeyboardLayout class with added buttons for the home buttons keyboard group.
public static VirtualKeyboardLayout CreateHomeGroupLayout(bool addArrowKeys = true)
A value indicating whether to include the arrow keys.
Returns:The created instance.
Creates a new object used for KeyFactory.
Creates a new instance of the VirtualKeyboardLayout class with added buttons for the main buttons keyboard group.
public static VirtualKeyboardLayout CreateMainButtonsKeyboardLayout(bool addEscapeKey = true, bool addArrowKeys = false)
A value indicating whether to include the escape key on the first row.
addArrowKeysboolA value indicating whether to include the arrow keys.
Returns:The created instance.
Creates a new object used for ToggleKeyFactory.
Creates a new instance of the VirtualKeyboardLayout class with added buttons for the traditional numpad keyboard group.
public static VirtualKeyboardLayout CreateTraditionalNumpadLayout()
The created instance.
Initializes member fields to their default values. This method is called prior the CreateChildItems one and allows for initialization of members on which child elements depend.
protected override void InitializeFields()
Overrides:
Measures the space required by the VirtualKeyboardLayout
Used by the layout system.
protected override SizeF MeasureOverride(SizeF availableSize)
The size that is available to the VirtualKeyboardLayout. The available size can be infinity (to take the full size of the element)
Returns:The minimum size required by the element to be completely visible. Cannot be infinity.
Overrides:
In this method call to the Measure method of each child must be made.
Resets the logical layout. When VirtualKeyboardLayoutPanels, VirtualKeyboardLayout and/or IKeys are added, removed or changed, this method needs to be called to refresh and update the logical layout.
public override void ResetLayout()
Overrides:
Gets a value indicating, whether a child will be arranged during the ArrangeOverride.
protected override bool ShouldArrangeChild(RadElement child)
The child.
Returns:Whether the child will be arranged in ArrangeOverride.
Overrides:
Updates the logical bounds of keys.
public void UpdateKeysLayout()