Class TriggerAction
Represents an attachable object that encapsulates a unit of functionality.
Implements
Inherited Members
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, IAttachedObject
Remarks
This is an infrastructure class. Action authors should derive from TriggerAction<T> instead of this class.
Fields
| Improve this Doc View SourceIsEnabledProperty
Declaration
public static readonly DependencyProperty IsEnabledProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
Properties
| Improve this Doc View SourceAssociatedObject
Gets the object to which this action is attached.
Declaration
protected DependencyObject AssociatedObject { get; }
Property Value
Type | Description |
---|---|
DependencyObject | The associated object. |
AssociatedObjectTypeConstraint
Gets the associated object type constraint.
Declaration
protected virtual Type AssociatedObjectTypeConstraint { get; }
Property Value
Type | Description |
---|---|
System.Type | The associated object type constraint. |
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 |
|
Methods
| Improve this Doc View SourceAttach(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. |
Detach()
Detaches this instance from its associated object.
Declaration
public void Detach()
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. |
OnAttached()
Called after the action is attached to an AssociatedObject.
Declaration
protected virtual void OnAttached()
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 SourceIAttachedObject.AssociatedObject
Gets the associated object.
Declaration
DependencyObject IAttachedObject.AssociatedObject { get; }
Returns
Type | Description |
---|---|
DependencyObject | The associated object. |