Bagikan melalui


ISelectionItemProvider.IsSelected Properti

Definisi

Mendapatkan nilai yang menunjukkan apakah item dipilih.

public:
 property bool IsSelected { bool get(); };
public bool IsSelected { get; }
member this.IsSelected : bool
Public ReadOnly Property IsSelected As Boolean

Nilai Properti

true jika elemen dipilih; jika tidak false.

Contoh

Contoh kode berikut mengembalikan true jika item ini berada dalam kumpulan item yang dipilih.

/// <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

Berlaku untuk

Lihat juga