Class TriggerBase
Represents an object that can invoke Actions conditionally.
Implements
Inherited Members
Namespace: System.Windows.Interactivity
Assembly: OpenSilver.Interactivity.dll
Syntax
public abstract class TriggerBase : DependencyObject, IAttachedObject
Remarks
This is an infrastructure class. Trigger authors should derive from Trigger<T> instead of this class.
Fields
| Improve this Doc View SourceActionsProperty
Declaration
public static readonly DependencyProperty ActionsProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
Properties
| Improve this Doc View SourceActions
Gets the actions associated with this trigger.
Declaration
public TriggerActionCollection Actions { get; }
Property Value
Type | Description |
---|---|
TriggerActionCollection | The actions associated with this trigger. |
AssociatedObject
Gets the object to which the trigger is attached.
Declaration
protected DependencyObject AssociatedObject { get; }
Property Value
Type | Description |
---|---|
DependencyObject | The associated object. |
AssociatedObjectTypeConstraint
Gets the type constraint of the associated object.
Declaration
protected virtual Type AssociatedObjectTypeConstraint { get; }
Property Value
Type | Description |
---|---|
System.Type | The associated object type constraint. |
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 trigger on more than one object at a time. |
System.InvalidOperationException | dependencyObject does not satisfy the trigger type constraint. |
Detach()
Detaches this instance from its associated object.
Declaration
public void Detach()
InvokeActions(Object)
Invoke all actions associated with this trigger.
Declaration
protected void InvokeActions(object parameter)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parameter |
Remarks
Derived classes should call this to fire the trigger.
OnAttached()
Called after the trigger is attached to an AssociatedObject.
Declaration
protected virtual void OnAttached()
OnDetaching()
Called when the trigger is being detached from its AssociatedObject, but before it has actually occurred.
Declaration
protected virtual void OnDetaching()
Events
| Improve this Doc View SourcePreviewInvoke
Event handler for registering to PreviewInvoke.
Declaration
public event EventHandler<PreviewInvokeEventArgs> PreviewInvoke
Event Type
Type | Description |
---|---|
System.EventHandler<PreviewInvokeEventArgs> |
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. |