New to Telerik UI for WPFStart a free 30-day trial

Represents the base class for virtual keyboard key view models.

Definition

Constructors

Initializes a new instance of the BaseKeyViewModel class.

C#
protected BaseKeyViewModel(int virtualKey, KeyType keyType, double keyWidth, double keyHeight)
Parameters:virtualKeyint

The virtual key.

keyTypeKeyType

The type of the key.

keyWidthdouble

The width of the key.

keyHeightdouble

The height of the key.

Properties

Gets or sets the text to be displayed for the key.

C#
public string DisplayText { get; set; }

Gets or sets the command to be executed hen the key is pressed.

C#
public ICommand KeyCommand { get; set; }

Gets the height of the key.

C#
public double KeyHeight { get; }

Gets the sound player that will be called to produce a sound when this key is pressed.

C#
public IKeySoundPlayer KeySoundPlayer { get; }

Gets the type of the key.

C#
public KeyType KeyType { get; }

Gets the width of the key.

C#
public double KeyWidth { get; }

ModifierKeys

ModifierKeys

Gets the state of the modifier keys from the last update.

C#
public ModifierKeys ModifierKeys { get; }

Gets the virtual key of the key.

C#
public int VirtualKey { get; }

Methods

Gets the state of the modifier keys (Shift, Ctrl...).

C#
protected ReadOnlyCollection<int> GetModifiers()
Returns:

ReadOnlyCollection<int>

The method called by the default command assigned to the key.

C#
protected abstract void OnKeyCommandExecuted(object commandParameter)
Parameters:commandParameterobject

Called when the state of the keyboard changes.

C#
public virtual void Update(IKeyUpdateContext context)
Parameters:contextIKeyUpdateContext