Compartilhar via


ISelectionItemProvider.IsSelected Propriedade

Definição

Obtém um valor que indica se um item está selecionado.

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

Valor da propriedade

Boolean

true se o elemento estiver selecionado; caso contrário false.

Exemplos

O código de exemplo a seguir retornará true se este item estiver na coleção de itens selecionados.

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

Aplica-se a

Confira também