18
A Drag And Drop Performant CollectionView for MAUI
source link: https://www.sharpnado.com/collectionview-maui/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
A Drag And Drop Performant CollectionView for MAUI
Jean-Marie Alfonsi
Feb 1, 2023
• 2 min read
I finally ported sharpnado's xamarin.forms collection view to dotnet MAUI \o/
Sharpnado's MAUI CollectionView on Github | |
- Performance oriented
- Horizontal, Grid, Carousel or Vertical layout
- Header, Footer and GroupHeader
- Reveal custom animations
- Drag and Drop
- Column count
- Infinite loading with Paginator component
- Snapping on first or middle element
- Padding and item spacing
- Handles
NotifyCollectionChangedAction
Add, Remove and Reset actions - View and data template recycling
RecyclerView
on AndroidUICollectionView
on iOS
0:00
/0:14
Installation
- In Core project, in
MauiProgram.cs
:
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp()
.UseSharpnadoCollectionView(loggerEnabled: false);
}
Usage
<!-- As a Grid -->
<sho:GridView
x:Name="HorizontalListView"
CollectionPadding="30"
ColumnCount="3"
EnableDragAndDrop="True"
HeightRequest="390"
HorizontalOptions="Fill"
ItemHeight="110"
ItemsSource="{Binding Logo, Mode=OneTime}" />
<!-- As a List with groups -->
<sho:CollectionView
CollectionLayout="Vertical"
CollectionPadding="0,30,0,30"
CurrentIndex="{Binding CurrentIndex}"
ItemHeight="120"
ItemTemplate="{StaticResource HeaderFooterGroupingTemplateSelector}"
ItemsSource="{Binding SillyPeople}"
ScrollBeganCommand="{Binding OnScrollBeginCommand}"
ScrollEndedCommand="{Binding OnScrollEndCommand}"
TapCommand="{Binding TapCommand}" />
<!-- As a carousel -->
<sho:CarouselView />
<!-- As a HorizontalListView -->
<sho:HorizontalListView />
Please find all the available documentation and a full maui app sample here:
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK