Show / Hide Table of Contents

Class UIElementExtendedRoutedEventExtensions

This class contains extension methods that mimic the AddHandler/RemoveHandler methods for routed events.

Inheritance
System.Object
UIElementExtendedRoutedEventExtensions
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
Assembly: OpenSilver.Controls.Toolkit.dll
Syntax
public static class UIElementExtendedRoutedEventExtensions
Remarks

These methods are in the System.Windows namespace so that they can be used as extension methods without bringing the Microsoft.Windows namespace into the scope.

Methods

| Improve this Doc View Source

AddHandler(UIElement, ExtendedRoutedEvent, Delegate, Boolean)

Adds a routed event handler for a specified routed event, adding the handler to the handler collection on the current element.

Declaration
public static void AddHandler(this UIElement that, ExtendedRoutedEvent routedEvent, Delegate handler, bool handledEventsToo)
Parameters
Type Name Description
UIElement that

The element to add a handler for.

ExtendedRoutedEvent routedEvent

An identifier for the routed event to be handled.

System.Delegate handler

A reference to the handler implementation.

System.Boolean handledEventsToo

True to register the handler such that it is invoked even when the routed event is marked handled in its event data; false to register the handler with the default condition that it will not be invoked if the routed event is already marked handled. The default is false.

| Improve this Doc View Source

RemoveHandler(UIElement, ExtendedRoutedEvent, Delegate)

Removes a routed event handler for a specified routed event, removing the handler from the handler collection on the current element.

Declaration
public static void RemoveHandler(this UIElement that, ExtendedRoutedEvent routedEvent, Delegate handler)
Parameters
Type Name Description
UIElement that

The element to remove the handler from.

ExtendedRoutedEvent routedEvent

An identifier for the routed event to be handled.

System.Delegate handler

A reference to the handler implementation.

  • Improve this Doc
  • View Source