ContextMenu.IsOpen Właściwość

Definicja

Pobiera lub ustawia wartość wskazującą, czy jest ona widoczna ContextMenu .

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

true jeśli jest ContextMenu 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 true.

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 ustawiono wartość true, przechwytywanie myszy jest ustawione na poddrzewo ContextMenu i .

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ż