ISelectionItemProvider.IsSelected 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得值,表示是否已選取項目。
public:
property bool IsSelected { bool get(); };
public bool IsSelected { get; }
member this.IsSelected : bool
Public ReadOnly Property IsSelected As Boolean
屬性值
如果已選取項目,則為 true
,否則為 false
。
範例
如果這個項目位於選取專案的集合中,下列範例程式代碼會 true
傳回 。
/// <summary>
/// Specifies whether the item is selected.
/// </summary>
/// <remarks>
/// selectedItems is the collection of selected ListItems.
/// </remarks>
public bool IsSelected
{
get
{
return selectedItems.Contains(this);
}
}
''' <summary>
''' Specifies whether the item is selected.
''' </summary>
''' <remarks>
''' selectedItems is the collection of selected ListItems.
''' </remarks>
Public ReadOnly Property IsSelected() As Boolean Implements ISelectionItemProvider.IsSelected
Get
Return selectedItems.Contains(Me)
End Get
End Property