Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

ContentElement.OnGotFocus Method

Raises the GotFocus routed event by using the event data provided.

Namespace:  System.Windows
Assembly:  PresentationCore (in PresentationCore.dll)
protected virtual void OnGotFocus(
	RoutedEventArgs e
)

Parameters

e
Type: System.Windows.RoutedEventArgs

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

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 IsFocused property value changes. The OnGotFocus 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 GotFocus 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 Focusable to false. Note that by default a Focusable is not focusable, therefore setting Focusable deliberately might not be necessary.

.NET Framework

Supported in: 4.5.1, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.