Bug 60033 - ListView override void SetupContent not triggered in UWP
Summary: ListView override void SetupContent not triggered in UWP
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 2.4.0
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2017-10-06 18:10 UTC by Andrew
Modified: 2018-02-23 15:18 UTC (History)
3 users (show)

Tags: listview, setupcontent, ac
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report for Bug 60033 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

Description Andrew 2017-10-06 18:10:18 UTC
Hi there! -

I've struggling with the following. When trying to extend the ListView and overriding the SetupContent()

    public class ListViewExt : ListView
        protected override void SetupContent(Cell cell, int index)
            base.SetupContent(cell, index);


This does not get trigger in a UWP project, however on iOS it works fine. What I'm missing here?
Here's the link to the sample project to illustrate. Any guidance on this is much appreciated.

Comment 1 Paul DiPietro [MSFT] 2017-10-06 19:26:01 UTC
I think there are some inconsistencies in behavior. Adding a reference to 45689.
Comment 2 Andrew 2017-10-11 19:08:23 UTC
is there a suggested work around as this being looked at? Or do we anticipate a resolution soon?
Comment 3 Paul DiPietro [MSFT] 2017-10-25 22:41:38 UTC
Try this for the time being:

		public class CustomListView : ListView
			public CustomListView() : base()
				TemplatedItems.CollectionChanged += TemplatedItems_CollectionChanged;

			protected override void SetupContent(Cell cell, int index)
				base.SetupContent(cell, index);

			void TemplatedItems_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
				foreach (var item in TemplatedItems)

			void Noop() { }
Comment 4 Andrew 2017-10-27 17:53:26 UTC
Great... this worked! Much appreciated
Comment 5 Paul DiPietro [MSFT] 2017-10-30 18:30:49 UTC
Comment 6 E 2017-11-17 15:08:52 UTC
@Paul DiPietro

If I implement your workaround, i'm getting the following error

- Unable to cast object of type 'XFLetsGrowApp.UWP.CustomListView' to type 'Xamarin.Forms.IRegisterable'."	string