Class TriggerBase
Represents an object that can invoke Actions conditionally.
public abstract class TriggerBase : Animatable, IAnimatable, IAttachedObject
- Inheritance
-
TriggerBase
- Implements
- Derived
- Inherited Members
- Extension Methods
Remarks
This is an infrastructure class. Trigger authors should derive from Trigger<T> instead of this class.
Fields
ActionsProperty
public static readonly DependencyProperty ActionsProperty
Field Value
Properties
Actions
Gets the actions associated with this trigger.
public TriggerActionCollection Actions { get; }
Property Value
- TriggerActionCollection
The actions associated with this trigger.
AssociatedObject
Gets the object to which the trigger is attached.
protected DependencyObject AssociatedObject { get; }
Property Value
- DependencyObject
The associated object.
AssociatedObjectTypeConstraint
Gets the type constraint of the associated object.
protected virtual Type AssociatedObjectTypeConstraint { get; }
Property Value
- Type
The associated object type constraint.
Methods
Attach(DependencyObject)
Attaches to the specified object.
public void Attach(DependencyObject dependencyObject)
Parameters
dependencyObject
DependencyObjectThe object to attach to.
Exceptions
- InvalidOperationException
Cannot host the same trigger on more than one object at a time.
- InvalidOperationException
dependencyObject does not satisfy the trigger type constraint.
CreateInstanceCore()
Creates a new instance of the TriggerBase derived class.
protected override Freezable CreateInstanceCore()
Returns
- Freezable
The new instance.
Detach()
Detaches this instance from its associated object.
public void Detach()
InvokeActions(object)
Invoke all actions associated with this trigger.
protected void InvokeActions(object parameter)
Parameters
parameter
object
Remarks
Derived classes should call this to fire the trigger.
OnAttached()
Called after the trigger is attached to an AssociatedObject.
protected virtual void OnAttached()
OnDetaching()
Called when the trigger is being detached from its AssociatedObject, but before it has actually occurred.
protected virtual void OnDetaching()
Events
PreviewInvoke
Event handler for registering to PreviewInvoke.
public event EventHandler<PreviewInvokeEventArgs> PreviewInvoke