FrameworkElementFactory.AddHandler FrameworkElementFactory.AddHandler FrameworkElementFactory.AddHandler Method

Definition

Adds an event handler for the given routed event to the instances created by this factory.

Overloads

AddHandler(RoutedEvent, Delegate) AddHandler(RoutedEvent, Delegate) AddHandler(RoutedEvent, Delegate)

Adds an event handler for the given routed event to the instances created by this factory.

AddHandler(RoutedEvent, Delegate, Boolean) AddHandler(RoutedEvent, Delegate, Boolean) AddHandler(RoutedEvent, Delegate, Boolean)

Adds an event handler for the given routed event to the instances created by this factory, with the option of having the provided handler be invoked even in cases of routed events that had already been marked as handled by another element along the route.

AddHandler(RoutedEvent, Delegate) AddHandler(RoutedEvent, Delegate) AddHandler(RoutedEvent, Delegate)

Adds an event handler for the given routed event to the instances created by this factory.

public:
 void AddHandler(System::Windows::RoutedEvent ^ routedEvent, Delegate ^ handler);
public void AddHandler (System.Windows.RoutedEvent routedEvent, Delegate handler);
member this.AddHandler : System.Windows.RoutedEvent * Delegate -> unit

Parameters

routedEvent
RoutedEvent RoutedEvent RoutedEvent

Identifier object for the routed event being handled.

handler
Delegate Delegate Delegate

A reference to the handler implementation.

AddHandler(RoutedEvent, Delegate, Boolean) AddHandler(RoutedEvent, Delegate, Boolean) AddHandler(RoutedEvent, Delegate, Boolean)

Adds an event handler for the given routed event to the instances created by this factory, with the option of having the provided handler be invoked even in cases of routed events that had already been marked as handled by another element along the route.

public:
 void AddHandler(System::Windows::RoutedEvent ^ routedEvent, Delegate ^ handler, bool handledEventsToo);
public void AddHandler (System.Windows.RoutedEvent routedEvent, Delegate handler, bool handledEventsToo);
member this.AddHandler : System.Windows.RoutedEvent * Delegate * bool -> unit

Parameters

routedEvent
RoutedEvent RoutedEvent RoutedEvent

Identifier object for the routed event being handled.

handler
Delegate Delegate Delegate

A reference to the handler implementation.

handledEventsToo
Boolean Boolean Boolean

Whether to invoke the handler in cases where the routed event has already been marked as handled in its arguments object. true to invoke the handler even when the routed event is marked handled; otherwise, false. The default is false. Asking to handle already-handled routed events is not common.

Applies to