FrameworkElementFactory.AddHandler Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Adds an event handler for the given routed event to the instances created by this factory.
Overloads
AddHandler(RoutedEvent, Delegate) |
Adds an event handler for the given routed event to the instances created by this factory. |
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)
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
Public Sub AddHandler (routedEvent As RoutedEvent, handler As Delegate)
Parameters
- routedEvent
- RoutedEvent
Identifier object for the routed event being handled.
- handler
- Delegate
A reference to the handler implementation.
Applies to
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
Public Sub AddHandler (routedEvent As RoutedEvent, handler As Delegate, handledEventsToo As Boolean)
Parameters
- routedEvent
- RoutedEvent
Identifier object for the routed event being handled.
- handler
- Delegate
A reference to the handler implementation.
- handledEventsToo
- 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.