ISelectionItemProvider.IsSelected Proprietà

Definizione

Ottiene un valore che indica se un elemento è selezionato.

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

Valore della proprietà

true se l'elemento è selezionato; in caso contrario, false.

Esempio

Il codice di esempio seguente restituisce true se questo elemento si trova nella raccolta di elementi selezionati.

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

Si applica a

Vedi anche