Class HardwareKeyListener
Hardware key listener: Configures what key stroke to listen for and what to do when it's heard.
Implements
Inherited Members
Namespace: Forms9Patch
Assembly: Forms9Patch.dll
Syntax
public class HardwareKeyListener : BindableObject, INotifyPropertyChanged, IDynamicResourceHandler
Constructors
HardwareKeyListener(HardwareKey, EventHandler<HardwareKeyEventArgs>)
Initializes a new instance of the HardwareKeyListener class.
Declaration
public HardwareKeyListener(HardwareKey hardwareKey, EventHandler<HardwareKeyEventArgs> onPressed = null)
Parameters
Type | Name | Description |
---|---|---|
HardwareKey | hardwareKey | Hardware key. |
EventHandler<HardwareKeyEventArgs> | onPressed | On pressed. |
Fields
CommandParameterProperty
The CommandParameter backing store
Declaration
public static readonly BindableProperty CommandParameterProperty
Field Value
Type | Description |
---|---|
BindableProperty |
CommandProperty
Backing store for the Command property
Declaration
public static readonly BindableProperty CommandProperty
Field Value
Type | Description |
---|---|
BindableProperty |
HardwareKeyProperty
Backing store for the HardwareKey property.
Declaration
public static readonly BindableProperty HardwareKeyProperty
Field Value
Type | Description |
---|---|
BindableProperty |
Pressed
The event that is triggered when this hardware key is pressed.
Declaration
public EventHandler<HardwareKeyEventArgs> Pressed
Field Value
Type | Description |
---|---|
EventHandler<HardwareKeyEventArgs> |
Properties
Command
Gets or sets the command to be invoked when the HardwareKey is pressed
Declaration
public ICommand Command { get; set; }
Property Value
Type | Description |
---|---|
ICommand | The command. |
CommandParameter
Gets or sets the command parameter sent with the command that is invoked when the key is pressed.
Declaration
public object CommandParameter { get; set; }
Property Value
Type | Description |
---|---|
Object | The command parameter. |
HardwareKey
Gets or sets the hardware key for which to be listened.
Declaration
public HardwareKey HardwareKey { get; set; }
Property Value
Type | Description |
---|---|
HardwareKey | The hardware key. |
Methods
ToString()
Returns a String that represents the current HardwareKeyListener.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String | A String that represents the current HardwareKeyListener. |