Class TargetedTriggerAction
Represents an action that can be targeted to affect an object other than its AssociatedObject.
Inheritance
Implements
Inherited Members
Namespace: System.Windows.Interactivity
Assembly: OpenSilver.Interactivity.dll
Syntax
public abstract class TargetedTriggerAction : TriggerAction, IAttachedObject
Remarks
This is an infrastructure class. Action authors should derive from TargetedTriggerAction<T> instead of this class.
Fields
| Improve this Doc View SourceTargetNameProperty
Declaration
public static readonly DependencyProperty TargetNameProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
TargetObjectProperty
Declaration
public static readonly DependencyProperty TargetObjectProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
Properties
| Improve this Doc View SourceAssociatedObjectTypeConstraint
Gets the associated object type constraint.
Declaration
protected sealed override Type AssociatedObjectTypeConstraint { get; }
Property Value
Type | Description |
---|---|
System.Type | The associated object type constraint. |
Overrides
Remarks
Define a TypeConstraintAttribute on a derived type to constrain the types it may be attached to.
Target
Gets the target object. If TargetObject is set, returns TargetObject. Else, if TargetName is not set or cannot be resolved, defaults to the AssociatedObject.
Declaration
protected object Target { get; }
Property Value
Type | Description |
---|---|
System.Object | The target object. |
Remarks
In general, this property should be used in place of AssociatedObject in derived classes.
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The Target element does not satisfy the type constraint. |
TargetName
Gets or sets the name of the object this action targets. If Target is set, this property is ignored. If Target is not set and TargetName is not set or cannot be resolved, the target will default to the AssociatedObject. This is a dependency property.
Declaration
public string TargetName { get; set; }
Property Value
Type | Description |
---|---|
System.String | The name of the target object. |
TargetObject
Gets or sets the target object. If TargetObject is not set, the target will look for the object specified by TargetName. If an element referred to by TargetName cannot be found, the target will default to the AssociatedObject. This is a dependency property.
Declaration
public object TargetObject { get; set; }
Property Value
Type | Description |
---|---|
System.Object | The target object. |
TargetTypeConstraint
Gets the target type constraint.
Declaration
protected Type TargetTypeConstraint { get; }
Property Value
Type | Description |
---|---|
System.Type | The target type constraint. |
Methods
| Improve this Doc View SourceOnAttached()
Called after the action is attached to an AssociatedObject.
Declaration
protected override void OnAttached()
Overrides
| Improve this Doc View SourceOnDetaching()
Called when the action is being detached from its AssociatedObject, but before it has actually occurred.
Declaration
protected override void OnDetaching()