共用方式為


ISelectionItemProvider.IsSelected 屬性

定義

取得值,表示是否已選取項目。

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

適用於

另請參閱