UIElement.IsKeyboardFocusWithin Właściwość
Definicja
Pobiera wartość wskazującą, czy fokus klawiatury znajduje się w dowolnym miejscu elementu lub jego elementów podrzędnych drzewa wizualnego.Gets a value indicating whether keyboard focus is anywhere within the element or its visual tree child elements. Jest to właściwość zależności.This is a dependency property.
public:
property bool IsKeyboardFocusWithin { bool get(); };
public bool IsKeyboardFocusWithin { get; }
member this.IsKeyboardFocusWithin : bool
Public ReadOnly Property IsKeyboardFocusWithin As Boolean
Wartość właściwości
true
Jeśli fokus klawiatury znajduje się na elemencie lub jego elementach podrzędnych; w przeciwnym razie false
.true
if keyboard focus is on the element or its child elements; otherwise, false
.
Implementuje
Uwagi
Zmiany wartości tej właściwości zwykle powodują wystąpienie IsKeyboardFocusWithinChanged zdarzenia, chyba że Klasa pochodna została zastąpiona, OnIsKeyboardFocusWithinChanged Aby pominąć zdarzenie.Changes to the value of this property typically raise the IsKeyboardFocusWithinChanged event, unless a derived class has overridden OnIsKeyboardFocusWithinChanged to suppress the event.
Ta właściwość nie jest ustawiana bezpośrednio, ale można ustawić fokus na element poprzez wywołanie metody Focus lub przez wykonanie MoveFocus żądania.You do not set this property directly, but you can set the focus to an element by calling Focus, or by making a MoveFocus request. Jedno z tych wywołań metod może zmienić tę wartość właściwości.Either of these method calls might change this property value.
IsKeyboardFocused i IsKeyboardFocusWithin są zwykle używane w ramach obsługi zdarzeń klasy dla innych zdarzeń związanych z danymi wejściowymi, na przykład w celu ustalenia, czy element ma już fokus klawiatury, czy też do określenia, kiedy zdarzenia myszy i zdarzenia klawiatury są wykonywane w połączeniu.IsKeyboardFocused and IsKeyboardFocusWithin are typically used within class event handlers for other input-related events, for instance to determine whether the element already has keyboard focus, or to make determinations when mouse events and keyboard events occur in conjunction.
Informacje dotyczące właściwości zależnościDependency Property Information
Pole identyfikatoraIdentifier field | IsKeyboardFocusWithinProperty |
Właściwości metadanych ustawione na true Metadata properties set to true |
BrakNone |