Class TargetedTriggerAction<T>
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<T> : TargetedTriggerAction, IAttachedObject where T : class
Type Parameters
Name | Description |
---|---|
T | The type constraint on the target. |
Remarks
TargetedTriggerAction extends TriggerAction to add knowledge of another element than the one it is attached to. This allows a user to invoke the action on an element other than the one it is attached to in response to a trigger firing. Override OnTargetChanged to hook or unhook handlers on the target element, and OnAttached/OnDetaching for the associated element. The type of the Target element can be constrained by the generic type parameter. If you need control over the type of the AssociatedObject, set a TypeConstraintAttribute on your derived type.
Constructors
| Improve this Doc View SourceTargetedTriggerAction()
Initializes a new instance of the TargetedTriggerAction<T> class.
Declaration
protected TargetedTriggerAction()
Properties
| Improve this Doc View SourceTarget
Gets the target object. If TargetName is not set or cannot be resolved, defaults to the AssociatedObject.
Declaration
protected T Target { get; }
Property Value
Type | Description |
---|---|
T | The target. |
Remarks
In general, this property should be used in place of AssociatedObject in derived classes.
Methods
| Improve this Doc View SourceOnTargetChanged(T, T)
Called when the target property changes.
Declaration
protected virtual void OnTargetChanged(T oldTarget, T newTarget)
Parameters
Type | Name | Description |
---|---|---|
T | oldTarget | The old target. |
T | newTarget | The new target. |
Remarks
Override this to hook and unhook functionality on the specified Target, rather than the AssociatedObject.