ContextMenu.IsOpen Właściwość

Definicja

Pobiera lub ustawia wartość wskazującą ContextMenu , czy element jest widoczny.

public:
 property bool IsOpen { bool get(); void set(bool value); };
[System.ComponentModel.Bindable(true)]
[System.ComponentModel.Browsable(false)]
public bool IsOpen { get; set; }
[<System.ComponentModel.Bindable(true)>]
[<System.ComponentModel.Browsable(false)>]
member this.IsOpen : bool with get, set
Public Property IsOpen As Boolean

Wartość właściwości

Boolean

truejeśli element ContextMenu jest widoczny; w przeciwnym razie . false Wartość domyślna to false.

Atrybuty

Przykłady

W tym przykładzie pokazano, jak sprawdzić, czy właściwość jest ustawiona IsOpen na truewartość .

if (cm.IsOpen == true)
{
    cmButton.Content = "The ContextMenu opened and the IsOpen property is true.";
}
If cm.IsOpen = True Then
    cmButton.Content = "The ContextMenu opened and the IsOpen property is true."
End If

Uwagi

Gdy IsOpen jest ustawiona wartość true, przechwytywanie myszy jest ustawione na ContextMenu i jego poddrzewo.

Informacje dotyczące właściwości zależności

Pole identyfikatora IsOpenProperty
Właściwości metadanych ustawione na true BindsTwoWayByDefault

Dotyczy

Zobacz też