I have a SfListView with an ItemTemplate in it. My idea is that there must have a GroupHeader to separate some items. Let me explain:
group header
bindable item
bindable item
bindable item
bindable item
bindable item
group header
static item
static item
group header
static item
static item
I alreay fill the bindable items, but not sure how to add the GroupHeader's and the static items
<listview:SfListView x:Name="listView" ItemsSource="{Binding MenuInfo}" AutoFitMode="Height" BackgroundColor="White">
<listview:SfListView.ItemTemplate>
<DataTemplate>
<StackLayout>
<Grid Padding="16,6,16,4">
<Label Text="{Binding MenuTexto}" TextColor="Black" FontSize="15" />
</Grid>
<BoxView IsVisible="{Binding .,Converter={StaticResource separatorVisibilityConverter}, ConverterParameter={x:Reference Name=listView}}" BackgroundColor="#93abd3" HeightRequest="1"/>
</StackLayout>
</DataTemplate>
</listview:SfListView.ItemTemplate>
</listview:SfListView>
The BoxView is a line separator
I fill the listview using this (the finall version will be readed from a Webservice)
menuInfo = new ObservableCollection<MenuInfo>();
menuInfo.Add(new MenuInfo() { MenuTexto = "Item 1", MenuInterno = "id1" });
menuInfo.Add(new MenuInfo() { MenuTexto = "Item 2", MenuInterno = "id2" });
menuInfo.Add(new MenuInfo() { MenuTexto = "Item 3", MenuInterno = "id3" });
I ended changinf the SfListview with a regular ListView
<ListView x:Name="listView" IsGroupingEnabled="true" HasUnevenRows="True" BackgroundColor="White">
<ListView.GroupHeaderTemplate>
<DataTemplate>
<ViewCell>
<StackLayout BackgroundColor="#989898">
<Label Text="{Binding Texto}" TextColor="White" FontAttributes="Bold" Padding="10,6,10,6" />
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.GroupHeaderTemplate>
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout>
<Label Text="{Binding Texto}" TextColor="#7f7f7f" Padding="10,12,10,12" />
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>