FocusManager.SetIsFocusScope(DependencyObject, Boolean) Yöntem

Tanım

Belirtileni DependencyObject odak kapsamı olarak ayarlar.

public:
 static void SetIsFocusScope(System::Windows::DependencyObject ^ element, bool value);
public static void SetIsFocusScope(System.Windows.DependencyObject element, bool value);
static member SetIsFocusScope : System.Windows.DependencyObject * bool -> unit
Public Shared Sub SetIsFocusScope (element As DependencyObject, value As Boolean)

Parametreler

element
DependencyObject

Odak kapsamı oluşturmak için öğesi.

value
Boolean

true odak kapsamıysa element ; değilse, false.

Örnekler

Aşağıdaki örnek kullanarak SetIsFocusScopebir öğeyi bir odak kapsamı haline getirir.

StackPanel focuseScope2 = new StackPanel();
FocusManager.SetIsFocusScope(focuseScope2, true);
Dim focuseScope2 As New StackPanel()
FocusManager.SetIsFocusScope(focuseScope2, True)

Açıklamalar

Odak alanı, alanı içerisindeki FocusManager.FocusedElement'ı takip eden bir kapsayıcı öğedir. Varsayılan olarak, Window sınıfı , ContextMenuve ToolBar sınıfları gibi bir odak kapsamıdırMenu. Odak kapsamı olan bir öğe olarak trueayarlanmıştırIsFocusScope.

Odak, klavye odağı ve mantıksal odak hakkında daha fazla bilgi için bkz. Girişe Genel Bakış.

Şunlara uygulanır