Class KeyTrigger
A Trigger that is triggered by a keyboard event. If the target Key and Modifiers are detected, it fires.
Inheritance
System.Object
KeyTrigger
Implements
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Microsoft.Expression.Interactivity.Input
Assembly: OpenSilver.Expression.Interactions.dll
Syntax
public class KeyTrigger : EventTriggerBase<UIElement>, IAttachedObject
Fields
| Improve this Doc View SourceActiveOnFocusProperty
Declaration
public static readonly DependencyProperty ActiveOnFocusProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
FiredOnProperty
Declaration
public static readonly DependencyProperty FiredOnProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
KeyProperty
Declaration
public static readonly DependencyProperty KeyProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
ModifiersProperty
Declaration
public static readonly DependencyProperty ModifiersProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
Properties
| Improve this Doc View SourceActiveOnFocus
If true, the Trigger only listens to its trigger Source object, which means that element must have focus for the trigger to fire. If false, the Trigger listens at the root, so any unhandled KeyDown/Up messages will be caught.
Declaration
public bool ActiveOnFocus { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
FiredOn
Determines whether or not to listen to the KeyDown or KeyUp event.
Declaration
public KeyTriggerFiredOn FiredOn { get; set; }
Property Value
Type | Description |
---|---|
KeyTriggerFiredOn |
Key
The key that must be pressed for the trigger to fire.
Declaration
public Key Key { get; set; }
Property Value
Type | Description |
---|---|
Key |
Modifiers
The modifiers that must be active for the trigger to fire (the default is no modifiers pressed).
Declaration
public ModifierKeys Modifiers { get; set; }
Property Value
Type | Description |
---|---|
ModifierKeys |
Methods
| Improve this Doc View SourceGetEventName()
Declaration
protected override string GetEventName()
Returns
Type | Description |
---|---|
System.String |
Overrides
| Improve this Doc View SourceOnDetaching()
Declaration
protected override void OnDetaching()
Overrides
| Improve this Doc View SourceOnEvent(EventArgs)
Declaration
protected override void OnEvent(EventArgs eventArgs)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | eventArgs |