ClassVirtualKeyboardLayout
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
VirtualKeyboardLayout()
Initializes new instance of the VirtualKeyboardLayout class.
Declaration
public VirtualKeyboardLayout()
Properties
KeySpacing
Gets or sets the logical spacing between keys.
Rows
Gets the logical rows collection.
Declaration
public ObservableCollection<Row> Rows { get; }
Property Value
TotalColumnsCount
Gets the total number of logical columns.
Declaration
public override double TotalColumnsCount { get; }
Property Value
Overrides
TotalRowsCount
Gets the total number of logical rows.
Declaration
public override double TotalRowsCount { get; }
Property Value
Overrides
Methods
AddEmptySpace(double, double)
Adds an empty space to the rows and children of VirtualKeyboardLayout.
AddKey(IKey)
Adds a IKey instance to the rows and children of VirtualKeyboardLayout.
AddKey(Key)
Adds a Key instance to the rows and children of VirtualKeyboardLayout.
AddKey(Keys, KeyType, double, double, bool, bool)
Adds a key to the rows and children of VirtualKeyboardLayout.
Declaration
public virtual IKey AddKey(Keys key, KeyType keyType, double width = 1, double height = 1, bool isSharpStyle = false, bool showSecondaryText = false)
Parameters
key
The key.
keyType
The type of the key.
width
The logical width of key.
height
The logical height of key.
isSharpStyle
Indicates whether the key has more noticeable(sharp) style.
showSecondaryText
Indicates whether to show the secondary text element.
Returns
The added key.
AddKey(ToggleKey)
Adds a ToggleKey instance to the rows and children of VirtualKeyboardLayout.
AddKey(int, KeyType, double, double, bool, bool)
Adds a key to the rows and children of VirtualKeyboardLayout.
Declaration
public virtual IKey AddKey(int virtualKeyCode, KeyType keyType, double width = 1, double height = 1, bool isSharpStyle = false, bool showSecondaryText = false)
Parameters
virtualKeyCode
The virtual key code.
keyType
The type of the key.
width
The logical width of key.
height
The logical height of key.
isSharpStyle
Indicates whether the key has more noticeable(sharp) style.
showSecondaryText
Indicates whether to show the secondary text element.
Returns
The added key.
AddKeyInternal(IKey)
Add a key to the VirtualKeyboardLayout.
Declaration
protected virtual IKey AddKeyInternal(IKey key)
Parameters
key
The key to be added.
Returns
Exceptions
If the key does not inherit from RadItem.
AddNumpadKey(Keys, string, Keys, string, double, double, bool, Font, Font)
Adds a numpad key to the rows and children of VirtualKeyboardLayout.
Declaration
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)
Parameters
numLockActiveKeyCode
The virtual key code of active state.
activeKeyText
The text in active state.
alternateKeyCode
The virtual key code in alternate mode.
alternateKeyText
The text in alternate state.
width
The logical width of key.
height
The logical height of key.
sharpStyle
Indicates whether the key has more noticeable(sharp) style.
activeKeyFont
The font specified to the key element in active state.
alternateKeyFont
The font specified to the key element in alternate state.
Returns
The added key.
AddSpecialKey(Keys, string, KeyType, double, double, bool, Font)
Adds a special key to the rows and children of VirtualKeyboardLayout.
Declaration
public virtual IKey AddSpecialKey(Keys key, string displayText, KeyType keyType, double width = 1, double height = 1, bool isSharpStyle = false, Font font = null)
Parameters
key
The key.
displayText
The display text.
keyType
The type of the key.
width
The logical width of key.
height
The logical height of key.
isSharpStyle
Indicates whether the key has more noticeable(sharp) style.
font
The font specified to the key element.
Returns
The added key.
AddSpecialKey(int, string, KeyType, double, double, bool, Font)
Adds a spacial key to the rows and children of VirtualKeyboardLayout.
Declaration
public virtual IKey AddSpecialKey(int virtualKeyCode, string displayText, KeyType keyType, double width = 1, double height = 1, bool isSharpStyle = false, Font font = null)
Parameters
virtualKeyCode
The virtual key code.
displayText
The display text.
keyType
The type of the key.
width
The logical width of key.
height
The logical height of key.
isSharpStyle
Indicates whether the key has more noticeable(sharp) style.
font
The font specified to the key element.
Returns
The added key.
AddToggleKey(Keys, string, KeyType, double, double, bool)
Adds a toggle key to the rows and children of VirtualKeyboardLayout.
Declaration
public virtual IKey AddToggleKey(Keys key, string displayText, KeyType keyType, double width = 1, double height = 1, bool isSharpStyle = false)
Parameters
key
The key.
displayText
The display text.
keyType
The type of the key.
width
The logical width of key.
height
The logical height of key.
isSharpStyle
Indicates whether the key has more noticeable(sharp) style.
Returns
The added key.
AddToggleKey(int, string, KeyType, double, double, bool)
Adds a toggle key to the rows and children of VirtualKeyboardLayout.
Declaration
public virtual IKey AddToggleKey(int virtualKeyCode, string displayText, KeyType keyType, double width = 1, double height = 1, bool isSharpStyle = false)
Parameters
virtualKeyCode
The virtual key code.
displayText
The display text.
keyType
The type of the key.
width
The logical width of key.
height
The logical height of key.
isSharpStyle
Indicates whether the key has more noticeable(sharp) style.
Returns
The added key.
ArrangeOverride(SizeF)
Arranges the VirtualKeyboardLayout to its final location. The element must call the Arrange method of each of its children.
Declaration
protected override SizeF ArrangeOverride(SizeF finalSize)
Parameters
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
Remarks
In this method call to the Arrange method of each child must be made.
CreateDefaultNumpadLayout()
Creates a new instance of the VirtualKeyboardLayout class with added buttons for the default numpad keyboard group.
Declaration
public static VirtualKeyboardLayout CreateDefaultNumpadLayout()
Returns
The created instance.
CreateExtendedKeyboardLayoutPanel(bool)
Creates a new instance of the VirtualKeyboardLayoutPanel class with added buttons for extended keyboard layout.
Declaration
public static VirtualKeyboardLayoutPanel CreateExtendedKeyboardLayoutPanel(bool includeFunctionKeys = true)
Parameters
includeFunctionKeys
A value indicating whether to include the function keys.
Returns
CreateFKeysLayout(bool)
Creates a new instance of the VirtualKeyboardLayout class with added buttons for the function buttons keyboard group.
Declaration
public static VirtualKeyboardLayout CreateFKeysLayout(bool addEscapeKey = true)
Parameters
addEscapeKey
A value indicating whether to include the escape key.
Returns
The created instance.
CreateHomeGroupLayout(bool)
Creates a new instance of the VirtualKeyboardLayout class with added buttons for the home buttons keyboard group.
Declaration
public static VirtualKeyboardLayout CreateHomeGroupLayout(bool addArrowKeys = true)
Parameters
addArrowKeys
A value indicating whether to include the arrow keys.
Returns
The created instance.
CreateKeyFactory()
Creates a new object used for KeyFactory.
Declaration
protected virtual IKeyFactory CreateKeyFactory()
Returns
The new instance.
CreateMainButtonsKeyboardLayout(bool, bool)
Creates a new instance of the VirtualKeyboardLayout class with added buttons for the main buttons keyboard group.
Declaration
public static VirtualKeyboardLayout CreateMainButtonsKeyboardLayout(bool addEscapeKey = true, bool addArrowKeys = false)
Parameters
addEscapeKey
A value indicating whether to include the escape key on the first row.
addArrowKeys
A value indicating whether to include the arrow keys.
Returns
The created instance.
CreateToggleKeyFactory()
Creates a new object used for ToggleKeyFactory.
Declaration
protected virtual IKeyFactory CreateToggleKeyFactory()
Returns
The new instance.
CreateTraditionalNumpadLayout()
Creates a new instance of the VirtualKeyboardLayout class with added buttons for the traditional numpad keyboard group.
Declaration
public static VirtualKeyboardLayout CreateTraditionalNumpadLayout()
Returns
The created instance.
GetAllKeys()
Gets a list with all IKey instances in this object and its children.
Declaration
public override IList<IKey> GetAllKeys()
Returns
IList<IKey>
The IList with all keys.
Overrides
GetAllRows()
Gets a list with all Row instances in this object and its children.
Declaration
public override IList<Row> GetAllRows()
Returns
IList<Row>
The IList with all rows.
Overrides
InitializeFields()
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.
Declaration
protected override void InitializeFields()
Overrides
MeasureOverride(SizeF)
Measures the space required by the VirtualKeyboardLayout
Used by the layout system.
Declaration
protected override SizeF MeasureOverride(SizeF availableSize)
Parameters
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
Remarks
In this method call to the Measure method of each child must be made.
ResetLayout()
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.
Declaration
public override void ResetLayout()
Overrides
ShouldArrangeChild(RadElement)
Gets a value indicating, whether a child will be arranged during the ArrangeOverride.
Declaration
protected override bool ShouldArrangeChild(RadElement child)
Parameters
child
The child.
Returns
Whether the child will be arranged in ArrangeOverride.
Overrides
UpdateKeysLayout()
Updates the logical bounds of keys.
Declaration
public void UpdateKeysLayout()