Class KeyTrigger
A Trigger that is triggered by a keyboard event. If the target Key and Modifiers are detected, it fires.
public class KeyTrigger : EventTriggerBase<UIElement>, IAttachedObject
- Inheritance
-
EventTriggerBase<UIElement>KeyTrigger
- Implements
- Inherited Members
Constructors
KeyTrigger()
public KeyTrigger()
Fields
ActiveOnFocusProperty
public static readonly DependencyProperty ActiveOnFocusProperty
Field Value
- DependencyProperty
FiredOnProperty
public static readonly DependencyProperty FiredOnProperty
Field Value
- DependencyProperty
KeyProperty
public static readonly DependencyProperty KeyProperty
Field Value
- DependencyProperty
ModifiersProperty
public static readonly DependencyProperty ModifiersProperty
Field Value
- DependencyProperty
Properties
ActiveOnFocus
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.
public bool ActiveOnFocus { get; set; }
Property Value
FiredOn
Determines whether or not to listen to the KeyDown or KeyUp event.
public KeyTriggerFiredOn FiredOn { get; set; }
Property Value
Key
The key that must be pressed for the trigger to fire.
public Key Key { get; set; }
Property Value
- Key
Modifiers
The modifiers that must be active for the trigger to fire (the default is no modifiers pressed).
public ModifierKeys Modifiers { get; set; }
Property Value
- ModifierKeys
Methods
GetEventName()
protected override string GetEventName()
Returns
OnDetaching()
Called when the trigger is being detached from its AssociatedObject, but before it has actually occurred.
protected override void OnDetaching()
OnEvent(EventArgs)
protected override void OnEvent(EventArgs eventArgs)
Parameters
eventArgs
EventArgs