Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Bug in ListView.HeaderTemplate?

$
0
0

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;
});

Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>