The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

UIElement.RemoveHandler Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Removes the specified routed event handler from this UIElement.

Namespace:  System.Windows
Assembly:  System.Windows (in System.Windows.dll)

public void RemoveHandler(
	RoutedEvent routedEvent,
	Delegate handler


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 UIElement.


routedEvent or handler is null.


routedEvent does not represent a supported routed event.


handler does not implement a supported delegate.


Attempted to remove handler for an event not supported by the current platform variation.

Important noteImportant Note:

RemoveHandler can only be used for the event handlers of the events that are supported by AddHandler. You cannot use RemoveHandler to remove handlers for general events that are added with the language-specific event wiring syntax (such as += in C#) or with event attribute in XAML. You should instead use language-specific event handler disconnection / removal syntax (such as -= in C#) for such event handlers.

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 null. Attempting to provide either value as null will raise an exception.

This method ignores the handledEventsToo parameter information of the symmetric AddHandler call.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone