Removes the specified routed event handler from this element.
Assembly: PresentationCore (in PresentationCore.dll)
'Declaration Public Sub RemoveHandler ( _ routedEvent As RoutedEvent, _ handler As Delegate _ )
- Type: System.Windows.RoutedEvent
The identifier of the routed event for which the handler is attached.
- Type: System.Delegate
The specific handler implementation to remove from the event handler collection on this element.
The most common scenario for using this API is when you implement the common language runtime (CLR) "wrapper" event that is associated with a custom routed event, specifically when you implement the "remove" logic for handlers at the CLR level.
Calling this method has no effect if there were no handlers registered with criteria that match the input parameters for the method call.
If more than one handler is attached that matched the criteria, only the first handler in the event handler store is removed. This behavior is consistent with CLR behavior of the -= operator.
Neither routedEvent nor handler may be Nothing. Attempting to provide either value as Nothing will raise an exception.
This method ignores the handledEventsToo parameter information, which is provided if the handler was first added with the AddHandler(RoutedEvent, Delegate, Boolean) signature that enables handling of already-handled events. Either type of handler is removed.
is introduced in the .NET Framework version 3.5. For more information, see .NET Framework Versions and Dependencies.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.