Show / Hide Table of Contents

Class TriggerAction

Represents an attachable object that encapsulates a unit of functionality.

Inheritance
System.Object
DependencyObject
TriggerAction
TargetedTriggerAction
TriggerAction<T>
Implements
IAttachedObject
Inherited Members
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: System.Windows.Interactivity
Assembly: OpenSilver.Interactivity.dll
Syntax
[DefaultTrigger(typeof(UIElement), typeof(EventTrigger), "MouseLeftButtonDown")]
[DefaultTrigger(typeof(ButtonBase), typeof(EventTrigger), "Click")]
public abstract class TriggerAction : DependencyObject, IDependencyObject, IAttachedObject
Remarks

This is an infrastructure class. Action authors should derive from TriggerAction<T> instead of this class.

Fields

| Improve this Doc View Source

IsEnabledProperty

Declaration
public static readonly DependencyProperty IsEnabledProperty
Field Value
Type Description
DependencyProperty

Properties

| Improve this Doc View Source

AssociatedObject

Gets the object to which this action is attached.

Declaration
protected DependencyObject AssociatedObject { get; }
Property Value
Type Description
DependencyObject

The associated object.

| Improve this Doc View Source

AssociatedObjectTypeConstraint

Gets the associated object type constraint.

Declaration
protected virtual Type AssociatedObjectTypeConstraint { get; }
Property Value
Type Description
System.Type

The associated object type constraint.

| Improve this Doc View Source

IsEnabled

Gets or sets a value indicating whether this action will run when invoked. This is a dependency property.

Declaration
public bool IsEnabled { get; set; }
Property Value
Type Description
System.Boolean

True if this action will be run when invoked; otherwise, False.

Methods

| Improve this Doc View Source

Attach(DependencyObject)

Attaches to the specified object.

Declaration
public void Attach(DependencyObject dependencyObject)
Parameters
Type Name Description
DependencyObject dependencyObject

The object to attach to.

Exceptions
Type Condition
System.InvalidOperationException

Cannot host the same TriggerAction on more than one object at a time.

System.InvalidOperationException

dependencyObject does not satisfy the TriggerAction type constraint.

| Improve this Doc View Source

Detach()

Detaches this instance from its associated object.

Declaration
public void Detach()
| Improve this Doc View Source

Invoke(Object)

Invokes the action.

Declaration
protected abstract void Invoke(object parameter)
Parameters
Type Name Description
System.Object parameter

The parameter to the action. If the action does not require a parameter, the parameter may be set to a null reference.

| Improve this Doc View Source

OnAttached()

Called after the action is attached to an AssociatedObject.

Declaration
protected virtual void OnAttached()
| Improve this Doc View Source

OnDetaching()

Called when the action is being detached from its AssociatedObject, but before it has actually occurred.

Declaration
protected virtual void OnDetaching()

Explicit Interface Implementations

| Improve this Doc View Source

IAttachedObject.AssociatedObject

Gets the associated object.

Declaration
DependencyObject IAttachedObject.AssociatedObject { get; }
Returns
Type Description
DependencyObject

The associated object.

Implements

IAttachedObject

Extension Methods

DependencyObjectHelper.GetSelfAndAncestors(DependencyObject)
VisualTreeExtensions.GetVisualAncestors(DependencyObject)
VisualTreeExtensions.GetVisualAncestorsAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualChildren(DependencyObject)
VisualTreeExtensions.GetVisualChildrenAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualDescendants(DependencyObject)
VisualTreeExtensions.GetVisualDescendantsAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualSiblings(DependencyObject)
VisualTreeExtensions.GetVisualSiblingsAndSelf(DependencyObject)
  • Improve this Doc
  • View Source