Back to Devexpress

DXCollectionView.DoubleTap Event

maui-devexpress-dot-maui-dot-collectionview-dot-dxcollectionview-4a6b15e0.md

latest3.2 KB
Original Source

DXCollectionView.DoubleTap Event

Occurs when a user taps a collection view item twice.

Namespace : DevExpress.Maui.CollectionView

Assembly : DevExpress.Maui.CollectionView.dll

NuGet Package : DevExpress.Maui.CollectionView

Declaration

csharp
public event EventHandler<CollectionViewGestureEventArgs> DoubleTap

Event Data

The DoubleTap event's data class is CollectionViewGestureEventArgs. The following properties provide information specific to this event:

PropertyDescription
ItemGets an object that specifies a data source’s item to which the CollectionView’s data row corresponds.
ItemHandleGets the handle of the processed item. Inherited from ItemEventArgs.

Remarks

You can use two methods to identify the tapped item. The event argument’s Item property returns the item’s corresponding data source object. To receive the item’s handle, use the ItemHandle property.

If the control allows item selection (SelectionMode is Single or Multiple), the SelectionChanged event also occurs after a user double-taps a Collection View item.

The DXCollectionView raises events in the following order for double taps with enabled selection:

As an alternative to the DoubleTap event, you can use the Collection View’s DoubleTapCommand.

Example

The following example shows how to delete the item tapped twice from the collection view and its bound data source:

xaml
<dxcv:DXCollectionView x:Name="collectionView"
                       DoubleTap="CollectionView_OnDoubleTap">
</dxcv:DXCollectionView>
csharp
void CollectionView_OnDoubleTap(object sender, CollectionViewGestureEventArgs e) {
    collectionView.DeleteItem(e.ItemHandle);
}

See Also

LongPress

DXCollectionView Class

DXCollectionView Members

DevExpress.Maui.CollectionView Namespace