Share via


FocusManager.SetIsFocusScope(DependencyObject, Boolean) Yöntem

Tanım

Belirtilen DependencyObject öğesini 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 öğe.

value
Boolean

true odak kapsamı ise 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 kapsamı, kapsamındaki öğesini FocusManager.FocusedElement izleyen bir kapsayıcı öğesidir. 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