Skip to main content
UIElementOnLostFocus Method
 

Raises the LostFocus routed event by using the event data that is provided.

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

Syntax
protected virtual void OnLostFocus(
	RoutedEventArgs e
)
protected:
virtual void OnLostFocus(
	RoutedEventArgs^ e
)
abstract OnLostFocus : 
        e:RoutedEventArgs -> unit
override OnLostFocus : 
        e:RoutedEventArgs -> unit
Protected Overridable Sub OnLostFocus (
	e As RoutedEventArgs
)

Parameters

e
Type:

A RoutedEventArgs that contains event data. This event data must contain the identifier for the LostFocus event.

Remarks

This method, although virtual, does have a default implementation that raises the event.

This On* method implementation is intended to raise the event, and this same method implementation is invoked internally to raise the event when the property value changes. This implementation differs from some other Windows Presentation Foundation (WPF) On* implementations, which only provide a convenient way to add class handling for that event.

Notes to Inheritors:

Unless you have a deliberate and unusual need to not raise the focus events, make sure that your implementation calls the base implementation. Otherwise, the LostFocus event is not raised during typical user operations that ordinarily set focus to this element. If you do not intend your element to be focusable, you can prevent the element from being focusable by setting to false.

Version Information
.NET Framework
Available since 3.0
Return to top