Skip to main content

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

public event EventHandler<CollectionViewGestureEventArgs> DoubleTap

Event Data

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

Property Description
Item Gets an object that specifies a data source’s item to which the CollectionView’s data row corresponds.
ItemHandle Gets 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:

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