var listView = new ListView {};
listView.SetBinding<IssueViewModel>(ListView.HeaderProperty, x => x.CurrentItem);
listView.HeaderTemplate = new DataTemplate(() =>
{
var cell = new ViewCell {View = new StackLayout()};
return cell;
});
it will crash on latest Xamarin.Forms (1.4.2.6355) with this exception:
System.ArgumentException: Value was an invalid value for HeaderTemplate
Parameter name: value
If anyone had same problem I found this workaround (works fine with binding, etc):
listView.HeaderTemplate = new DataTemplate(() =>
{
var cell = new StackLayout();
return cell;
});