정보
요청한 주제가 아래에 표시됩니다. 그러나 이 주제는 이 라이브러리에 포함되지 않습니다.

UIElement.RemoveHandler 메서드

Removes the specified routed event handler from this element.

네임스페이스: System.Windows
어셈블리: PresentationCore(presentationcore.dll)

public void RemoveHandler (
	RoutedEvent routedEvent,
	Delegate handler
)
public final void RemoveHandler (
	RoutedEvent routedEvent, 
	Delegate handler
)
public final function RemoveHandler (
	routedEvent : RoutedEvent, 
	handler : Delegate
)
XAML에서 메서드를 사용할 수 없습니다.

매개 변수

routedEvent

The identifier of the routed event for which the handler is attached.

handler

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. The example that follows this remarks section illustrates this scenario.

Calling this method has no effect if there were no handlers registered with criteria that matches 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 참조(Visual Basic의 경우 Nothing). Attempting to provide either value as null 참조(Visual Basic의 경우 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.

The following example uses RemoveHandler as part of an event wrapper definition.

public static readonly RoutedEvent TapEvent = EventManager.RegisterRoutedEvent("Tap", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(MyButtonSimple));

// Provide CLR accessors for the event
public event RoutedEventHandler Tap
   {
          add { AddHandler(TapEvent, value); } 
          remove { RemoveHandler(TapEvent, value); }
   }

Microsoft .NET Framework 3.0은 Windows Vista, Microsoft Windows XP SP2 및 Windows Server 2003 SP1에서 지원됩니다.

.NET Framework

3.0에서 지원

커뮤니티 추가 항목

표시:
© 2015 Microsoft