次の方法で共有


ContextMenu.IsOpen プロパティ

定義

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

プロパティ値

true ContextMenuが表示されている場合は。それ以外の場合はfalse。 既定値は、false です。

属性

この例では、 IsOpen プロパティが true に設定されているかどうかを確認する方法を示します。

if (cm.IsOpen)
{
    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

注釈

IsOpentrueに設定されている場合、マウス キャプチャはContextMenuとそのサブツリーに設定されます。

依存関係プロパティ情報

品目 価値
識別子フィールド IsOpenProperty
に設定されたメタデータ プロパティ true BindsTwoWayByDefault

適用対象

こちらもご覧ください