Gathered from the documentation:
EmptyView, of type object, the string, binding, or view that will be displayed when the ItemsSource property is null, or when the collection specified by the ItemsSource property is null or empty. The default value is null.
So, im working on a Xamarin Forms app which only has the Android Module right now, I wanted to display a message like the example shown in the documentation by just providing the value of EmptyView like this:
EmptyView="No combos to display. Why don't you add some?"
This is added in the following code:
<CollectionView ItemsSource="{Binding ComboList}"
IsGrouped="True" SelectionMode="None"
EmptyView="No combos to display. Why don't you add some?"
RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1}"
RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=1}">
<CollectionView.Header>
<StackLayout>
<Label Text="{xt:Translate character_facing_right}"
Margin="{StaticResource HeaderLabelMargin}"
FontSize="Medium"
HorizontalOptions="Center"/>
</StackLayout>
</CollectionView.Header>
<CollectionView.GroupHeaderTemplate>
...
</CollectionView.GroupHeaderTemplate>
<CollectionView.ItemTemplate>
<DataTemplate x:DataType="models:ComboView">
<controls:ComboItem Title="{Binding Title}"
Combo="{Binding Combo}"
IsStock="{Binding IsStock}"
Type="{Binding Type}"
UniqueId="{Binding UniqueId}"
Comment="{Binding Comment}"/>
</DataTemplate>
</CollectionView.ItemTemplate>
<CollectionView.Footer>
...
</CollectionView.Footer>
</CollectionView>
However, when testing, i can see the header of my list but not the EmptyView, even though the list is empty. What am i missing?