Is there any way we can hide CollectionView's group header if the group is empty when grouping is enabled?
Let's take the example from the official docs:
// Extended List public class AnimalGroup : List<Animal> { public string Name { get; private set; } public AnimalGroup(string name, List<Animal> animals) : base(animals) { Name = name; } } // Viewmodel property public List<AnimalGroup> Animals { get; private set; } = new List<AnimalGroup>(); // View <CollectionView ItemsSource="{Binding Animals}" IsGrouped="true"> <CollectionView.GroupHeaderTemplate> <DataTemplate> <Label Text="{Binding Name}" BackgroundColor="LightGray" FontSize="Large" FontAttributes="Bold" /> </DataTemplate> </CollectionView.GroupHeaderTemplate> <CollectionView.ItemTemplate> <DataTemplate> ............... </DataTemplate> </CollectionView.ItemTemplate> </CollectionView>
Is it possible to hide the group header if the items of that header are empty?