Show / Hide Table of Contents

Class EventObserver

EventObserver is designed to help manage event handlers by detatching when disposed. Creating this object will also attach in the constructor.

Inheritance
System.Object
EventObserver
Implements
System.IDisposable
Inherited Members
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 sealed class EventObserver : IDisposable

Constructors

| Improve this Doc View Source

EventObserver(EventInfo, Object, Delegate)

Creates an instance of EventObserver and attaches to the supplied event on the supplied target. Call dispose to detach.

Declaration
public EventObserver(EventInfo eventInfo, object target, Delegate handler)
Parameters
Type Name Description
System.Reflection.EventInfo eventInfo

The event to attach and detach from.

System.Object target

The target object the event is defined on. Null if the method is static.

System.Delegate handler

The delegate to attach to the event.

Methods

| Improve this Doc View Source

Dispose()

Detaches the handler from the event.

Declaration
public void Dispose()

Implements

System.IDisposable
  • Improve this Doc
  • View Source