From 238c00b20772fbfe36ce1f290ac2d25c6275bf8a Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Mon, 18 Jul 2016 07:54:04 -0700 Subject: Ensure BindingContext is properly passed to CreateDefault in UWP ListView (#259) --- .../Bugzilla41205.cs | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla41205.cs (limited to 'Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla41205.cs') diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla41205.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla41205.cs new file mode 100644 index 00000000..fe578a39 --- /dev/null +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla41205.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Text; +using Xamarin.Forms.CustomAttributes; +using Xamarin.Forms.Internals; + +namespace Xamarin.Forms.Controls.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 41205, "UWP CreateDefault passes string instead of object")] + public class Bugzilla41205 : ContentPage + { + public class CustomListView : ListView + { + protected override Cell CreateDefault(object item) + { + if (item is ViewModel) + return base.CreateDefault("Pass"); + return base.CreateDefault("Fail"); + } + } + + public Bugzilla41205() + { + var listView = new CustomListView + { + ItemsSource = new [] + { + new ViewModel(), + new ViewModel(), + } + }; + + Content = listView; + } + + } +} -- cgit v1.2.3