LosingFocusEventArgs Class
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.
Provides data for the FocusManager.LosingFocus and UIElement.LosingFocus events.
public ref class LosingFocusEventArgs sealed : RoutedEventArgs
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.UI.Xaml.WinUIContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class LosingFocusEventArgs final : RoutedEventArgs
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.UI.Xaml.WinUIContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class LosingFocusEventArgs : RoutedEventArgs
Public NotInheritable Class LosingFocusEventArgs
Inherits RoutedEventArgs
- Inheritance
- Attributes
Remarks
Only a single UI element at a time can have focus.
A control can lose focus when another control gets focus, the application view changes, the user switches applications, or the user interacts with the system such that the application is no longer in the foreground.
Properties
Cancel |
Gets or sets whether focus navigation should be canceled. |
CorrelationId |
Gets the unique ID generated when a focus movement event is initiated. |
Direction |
Gets the direction that focus moved from element to element within the app UI. |
FocusState |
Gets the input mode through which an element obtained focus. |
Handled |
Gets or sets a value that marks the routed event as handled. A |
InputDevice |
Gets the input device type from which input events are received. |
NewFocusedElement |
Gets the most recent focused object. |
OldFocusedElement |
Gets the last focused object. |
OriginalSource |
Gets a reference to the object that raised the event. This is often a template part of a control rather than an element that was declared in your app UI. (Inherited from RoutedEventArgs) |
Methods
TryCancel() |
Attempts to cancel the ongoing focus action. |
TrySetNewFocusedElement(DependencyObject) |
Attempts to redirect focus from the targeted element to the specified element. |