GettingFocusEventArgs 類別

定義

public ref class GettingFocusEventArgs sealed : RoutedEventArgs
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 262144)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class GettingFocusEventArgs final : RoutedEventArgs
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 262144)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class GettingFocusEventArgs : RoutedEventArgs
Public NotInheritable Class GettingFocusEventArgs
Inherits RoutedEventArgs
繼承
Object Platform::Object IInspectable RoutedEventArgs GettingFocusEventArgs
屬性

Windows 需求

裝置系列
Windows 10 Creators Update (已於 10.0.15063.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v4.0 引進)

備註

一次只能有單一 UI 元素的焦點。

當另一個控制項失去焦點、應用程式檢視變更、使用者切換應用程式或使用者與系統互動時,控制項可以取得焦點,讓應用程式不再位於前景。

版本歷程記錄

Windows 版本 SDK 版本 已新增值
1803 17134 TryCancel
1803 17134 TrySetNewFocusedElement
1809 17763 CorrelationId

屬性

Cancel

取得或設定是否應該取消焦點流覽。

CorrelationId

取得起始焦點移動事件時所產生的唯一識別碼。

Direction

取得焦點從專案移至應用程式 UI 內元素的方向。

FocusState

取得專案取得焦點的輸入模式。

Handled

取得或設定值,這個值會將路由事件標示為已處理。 Handledtrue值可防止事件路由中的大部分處理常式再次處理相同的事件。

InputDevice

取得從中接收輸入事件的輸入裝置類型。

NewFocusedElement

取得最新的焦點物件。

OldFocusedElement

取得最後一個焦點物件。

OriginalSource

取得引發事件之 物件的參考。 這通常是控制項的範本部分,而不是在應用程式 UI 中宣告的專案。

(繼承來源 RoutedEventArgs)

方法

TryCancel()

嘗試取消進行中的焦點動作。

TrySetNewFocusedElement(DependencyObject)

嘗試將焦點重新導向至指定的專案,而不是原始的目標專案。

適用於

另請參閱