I create ViewCell for CategoryProductsHeader and applied it. But nothing changes.
ListView listView = new CategoryListView
{
HasUnevenRows = true,
ItemTemplate = new DataTemplate(typeof(CategoryProductsCell)),
GroupHeaderTemplate = new DataTemplate(typeof(CategoryProductsHeader)),
ItemsSource = productGroups,
IsGroupingEnabled = true,
GroupDisplayBinding = new Binding("Name"),
BackgroundColor = Color.Black,
};
`
public class CategoryProductsHeader : ViewCell
{
public CategoryProductsHeader()
{
Label text = new Label()
{
FontSize = 18,
XAlign = TextAlignment.Center,
YAlign = TextAlignment.Center,
};
text.SetBinding(Label.TextProperty, "Name");
var line = new BoxView()
{
Color = Color.FromHex("#BE0000"),
HeightRequest = 1,
};
StackLayout layout = new StackLayout()
{
Orientation = StackOrientation.Vertical,
HorizontalOptions = LayoutOptions.FillAndExpand,
VerticalOptions = LayoutOptions.FillAndExpand,
BackgroundColor=Color.Gray,
Children = { line, text, line }
};
this.View = layout;
}
}
`