Show / Hide Table of Contents

Class EventTriggerBase

Represents a trigger that can listen to an object other than its AssociatedObject.

Inheritance
System.Object
DependencyObject
TriggerBase
EventTriggerBase
EventTriggerBase<T>
Implements
IAttachedObject
Inherited Members
TriggerBase.ActionsProperty
TriggerBase.AssociatedObject
TriggerBase.Actions
TriggerBase.PreviewInvoke
TriggerBase.InvokeActions(Object)
TriggerBase.IAttachedObject.AssociatedObject
TriggerBase.Attach(DependencyObject)
TriggerBase.Detach()
DependencyObject.GetValue(DependencyProperty)
DependencyObject.SetCurrentValue(DependencyProperty, Object)
DependencyObject.ReadLocalValue(DependencyProperty)
DependencyObject.SetValue(DependencyProperty, Object)
DependencyObject.SetValue(DependencyPropertyKey, Object)
DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs)
DependencyObject.CoerceValue(DependencyProperty)
DependencyObject.Dispatcher
DependencyObject.INTERNAL_OnAttachedToVisualTree()
DependencyObject.INTERNAL_OnDetachedFromVisualTree()
DependencyObject.ClearValue(DependencyProperty)
DependencyObject.ClearValue(DependencyPropertyKey)
DependencyObject.CheckAccess()
DependencyObject.GetAnimationBaseValue(DependencyProperty)
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: System.Windows.Interactivity
Assembly: OpenSilver.Interactivity.dll
Syntax
public abstract class EventTriggerBase : TriggerBase, IDependencyObject, IAttachedObject
Remarks

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

Fields

| Improve this Doc View Source

SourceNameProperty

Declaration
public static readonly DependencyProperty SourceNameProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

SourceObjectProperty

Declaration
public static readonly DependencyProperty SourceObjectProperty
Field Value
Type Description
DependencyProperty

Properties

| Improve this Doc View Source

AssociatedObjectTypeConstraint

Gets the type constraint of the associated object.

Declaration
protected sealed override Type AssociatedObjectTypeConstraint { get; }
Property Value
Type Description
System.Type

The associated object type constraint.

Overrides
TriggerBase.AssociatedObjectTypeConstraint
Remarks

Define a TypeConstraintAttribute on a derived type to constrain the types it may be attached to.

| Improve this Doc View Source

Source

Gets the resolved source. If is not set or cannot be resolved, defaults to AssociatedObject.

Declaration
public object Source { get; }
Property Value
Type Description
System.Object

The resolved source object.

Remarks

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

Exceptions
Type Condition
System.InvalidOperationException

The element pointed to by does not satisify the type constraint.

| Improve this Doc View Source

SourceName

Gets or sets the name of the element this EventTriggerBase listens for as a source. If the name is not set or cannot be resolved, the AssociatedObject will be used. This is a dependency property.

Declaration
public string SourceName { get; set; }
Property Value
Type Description
System.String

The name of the source element.

| Improve this Doc View Source

SourceObject

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 SourceObject { get; set; }
Property Value
Type Description
System.Object

The target object.

| Improve this Doc View Source

SourceTypeConstraint

Gets the source type constraint.

Declaration
protected Type SourceTypeConstraint { get; }
Property Value
Type Description
System.Type

The source type constraint.

Methods

| Improve this Doc View Source

GetEventName()

Specifies the name of the Event this EventTriggerBase is listening for.

Declaration
protected abstract string GetEventName()
Returns
Type Description
System.String
| Improve this Doc View Source

OnAttached()

Called after the trigger is attached to an AssociatedObject.

Declaration
protected override void OnAttached()
Overrides
TriggerBase.OnAttached()
| Improve this Doc View Source

OnDetaching()

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

Declaration
protected override void OnDetaching()
Overrides
TriggerBase.OnDetaching()
| Improve this Doc View Source

OnEvent(EventArgs)

Called when the event associated with this EventTriggerBase is fired. By default, this will invoke all actions on the trigger.

Declaration
protected virtual void OnEvent(EventArgs eventArgs)
Parameters
Type Name Description
System.EventArgs eventArgs

The System.EventArgs instance containing the event data.

Remarks

Override this to provide more granular control over when actions associated with this trigger will be invoked.

Implements

IAttachedObject

Extension Methods

DependencyObjectHelper.GetSelfAndAncestors(DependencyObject)
VisualTreeExtensions.GetVisualAncestors(DependencyObject)
VisualTreeExtensions.GetVisualAncestorsAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualChildren(DependencyObject)
VisualTreeExtensions.GetVisualChildrenAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualDescendants(DependencyObject)
VisualTreeExtensions.GetVisualDescendantsAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualSiblings(DependencyObject)
VisualTreeExtensions.GetVisualSiblingsAndSelf(DependencyObject)
  • Improve this Doc
  • View Source