The WCollectionView is a Grid Collection View for Xamarin Forms, where you can define a custom height for each item,
getting the "Waterfall" effect. If you don't provide the GetHeightForItemDelegate
, you can define a min. & max. heights, so the control will set a random height between those values.
- Column Count
- Custom item height
- Grouping
- Pull To Refresh
- Header
- Item Tapped Event
- Header Tapped Event
ColumnCount = 2
MinCellHeight = 150
MaxCellHeight = 250
HeaderTemplateHeight = 250
IsPullToRefreshEnabled = false
IsGroupingEnabled = false
On Android, in your main Activity
's OnCreate (..)
implementation, call:
Wapps.Forms.Controls.Droid.WCollectionViewRenderer.Init(this);
In your AppDelegate
's FinishedLaunching (..)
implementation, call:
Wapps.Forms.Controls.iOS.WCollectionViewRenderer.Init();
double Lv_HeightForCellDelegate(object item)
{
//calculate the item height here
return 0;
}
void WCollectionView_ItemTapped(object sender, Wapps.Forms.Controls.WItemTappedEventArgs args)
{
}
Setting IsGroupingEnabled = true
you can define a GroupHeaderTemplate
and set the ItemsSource
a IEnumerable<IEnumerable>
.
You can handle the Group Header tapped event
void WCollectionView_HeaderTapped(object sender, Wapps.Forms.Controls.WItemTappedEventArgs args)
{
}