Show / Hide Table of Contents

Class KeyTrigger

A Trigger that is triggered by a keyboard event. If the target Key and Modifiers are detected, it fires.

Inheritance
System.Object
DependencyObject
TriggerBase
EventTriggerBase
EventTriggerBase<UIElement>
KeyTrigger
Implements
IAttachedObject
Inherited Members
EventTriggerBase<UIElement>.Source
EventTriggerBase<UIElement>.OnSourceChanged(UIElement, UIElement)
EventTriggerBase.SourceObjectProperty
EventTriggerBase.SourceNameProperty
EventTriggerBase.AssociatedObjectTypeConstraint
EventTriggerBase.SourceTypeConstraint
EventTriggerBase.SourceObject
EventTriggerBase.SourceName
EventTriggerBase.OnAttached()
TriggerBase.ActionsProperty
TriggerBase.AssociatedObject
TriggerBase.Actions
TriggerBase.PreviewInvoke
TriggerBase.InvokeActions(Object)
TriggerBase.IAttachedObject.AssociatedObject
TriggerBase.Attach(DependencyObject)
TriggerBase.Detach()
DependencyObject.GetValue(DependencyProperty)
DependencyObject.SetCurrentValue(DependencyProperty, Object)
DependencyObject.ReadLocalValue(DependencyProperty)
DependencyObject.SetValue(DependencyProperty, Object)
DependencyObject.SetValue(DependencyPropertyKey, Object)
DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs)
DependencyObject.CoerceValue(DependencyProperty)
DependencyObject.Dispatcher
DependencyObject.INTERNAL_OnAttachedToVisualTree()
DependencyObject.INTERNAL_OnDetachedFromVisualTree()
DependencyObject.ClearValue(DependencyProperty)
DependencyObject.ClearValue(DependencyPropertyKey)
DependencyObject.CheckAccess()
DependencyObject.GetAnimationBaseValue(DependencyProperty)
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>, IDependencyObject, IAttachedObject

Fields

| Improve this Doc View Source

ActiveOnFocusProperty

Declaration
public static readonly DependencyProperty ActiveOnFocusProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

FiredOnProperty

Declaration
public static readonly DependencyProperty FiredOnProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

KeyProperty

Declaration
public static readonly DependencyProperty KeyProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

ModifiersProperty

Declaration
public static readonly DependencyProperty ModifiersProperty
Field Value
Type Description
DependencyProperty

Properties

| Improve this Doc View Source

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.

Declaration
public bool ActiveOnFocus { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

FiredOn

Determines whether or not to listen to the KeyDown or KeyUp event.

Declaration
public KeyTriggerFiredOn FiredOn { get; set; }
Property Value
Type Description
KeyTriggerFiredOn
| Improve this Doc View Source

Key

The key that must be pressed for the trigger to fire.

Declaration
public Key Key { get; set; }
Property Value
Type Description
Key
| Improve this Doc View Source

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 Source

GetEventName()

Declaration
protected override string GetEventName()
Returns
Type Description
System.String
Overrides
EventTriggerBase.GetEventName()
| Improve this Doc View Source

OnDetaching()

Declaration
protected override void OnDetaching()
Overrides
EventTriggerBase.OnDetaching()
| Improve this Doc View Source

OnEvent(EventArgs)

Declaration
protected override void OnEvent(EventArgs eventArgs)
Parameters
Type Name Description
System.EventArgs eventArgs
Overrides
EventTriggerBase.OnEvent(EventArgs)

Implements

IAttachedObject

Extension Methods

DependencyObjectHelper.GetSelfAndAncestors(DependencyObject)
  • Improve this Doc
  • View Source