Skip to content

Latest commit

 

History

History

LongTap

DevExpress CollectionView for .NET MAUI - Enable Multiple Selection and Implement the Contextual Action Bar

This example shows how to use the DXCollectionView.LongPress event to enable multiple item selection.

Requirements

Register the DevExpress NuGet Gallery in Visual Studio to restore NuGet packages used in this solution. See the following topic for more information: Get Started with DevExpress Mobile UI for .NET MAUI.

You can also refer to the following YouTube video for more information on how to get started with the DevExpress .NET MAUI Controls: Setting up a .NET MAUI Project.

Implementation Details

  • Handle the DXCollectionView.LongPress event and set the DXCollectionView.SelectionMode property to Multiple.
  • Use the DXCollectionView.SelectedItemTemplate property to specify a template for selected items.
  • You can create a ContentView descendant to implement common visual elements for a regular and selected templates. This example uses the SelectableItem (ContentView descendant) class that contains the IsSelected property. The appearance of this class is defined in the itemBaseTemplate.
  • When a CollectionView item is selected, the application title displays custom actions. You can use the Shell.TitleView property to define these actions.

Files to Review

Documentation

More Examples