Table of Contents

Class TargetedTriggerAction

Namespace
HeBianGu.Base.WpfBase
Assembly
HeBianGu.Base.WpfBase.dll

Represents an action that can be targeted to affect an object other than its AssociatedObject.

public abstract class TargetedTriggerAction : TriggerAction, IAnimatable, IAttachedObject
Inheritance
TargetedTriggerAction
Implements
Derived
Inherited Members
Extension Methods

Remarks

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

Fields

TargetNameProperty

public static readonly DependencyProperty TargetNameProperty

Field Value

DependencyProperty

TargetObjectProperty

public static readonly DependencyProperty TargetObjectProperty

Field Value

DependencyProperty

Properties

AssociatedObjectTypeConstraint

Gets the associated object type constraint.

protected override sealed Type AssociatedObjectTypeConstraint { get; }

Property Value

Type

The associated object type constraint.

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.

protected object Target { get; }

Property Value

object

The target object.

Remarks

In general, this property should be used in place of AssociatedObject in derived classes.

Exceptions

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.

public string TargetName { get; set; }

Property Value

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.

public object TargetObject { get; set; }

Property Value

object

The target object.

TargetTypeConstraint

Gets the target type constraint.

protected Type TargetTypeConstraint { get; }

Property Value

Type

The target type constraint.

Methods

OnAttached()

Called after the action is attached to an AssociatedObject.

protected override void OnAttached()

OnDetaching()

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

protected override void OnDetaching()