Bug 52239 - When using templates ListView ItemSelected event does not fire
Summary: When using templates ListView ItemSelected event does not fire
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 2.3.3
Hardware: Macintosh Mac OS
: High normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2017-02-01 23:03 UTC by Jesse Liberty
Modified: 2017-06-03 14:45 UTC (History)
5 users (show)

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

Sample project (327.94 KB, application/x-zip-compressed)
2017-02-24 22:38 UTC, Paul DiPietro [MSFT]

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 on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Jesse Liberty 2017-02-01 23:03:52 UTC
When using ContentPresenter (https://developer.xamarin.com/api/type/Xamarin.Forms.ContentPresenter/) as per this article: https://xamarinhelp.com/xamarin-forms-page-templates/ everything works fine, and all bindings work, but the ListView's ItemSelected event does not fire.
Comment 1 Paul DiPietro [MSFT] 2017-02-24 22:37:45 UTC
I'm attaching a reproduction that appears to work and fires ItemSelected. If there's a misunderstanding and/or you're experiencing something different, please do upload your own reproduction with some more info about your environment. I'll set this to not reproducible for the time being.
Comment 2 Paul DiPietro [MSFT] 2017-02-24 22:38:04 UTC
Created attachment 19960 [details]
Sample project
Comment 3 Jesse Liberty 2017-02-25 15:44:15 UTC
Please see email I sent  The sample project does not seem to show that the ItemSelected event fires, and when I implement the event handler it is never called.

Comment 4 Paul DiPietro [MSFT] 2017-02-25 17:36:07 UTC
The event handler method is implemented in App.xaml.cs. If you add a DisplayAlert call to that method, you should see that it shows the item in the alert when selected:

Application.Current.MainPage.DisplayAlert(e.SelectedItem.ToString(), "OK", "Cancel");
Comment 5 David Ortinau [MSFT] 2017-06-03 14:45:57 UTC
Jesse I'm also not able to reproduce the issue on Mac or PC, iOS or Android. The event fires and is handled. v2.3.3.193

If this is still happening for you, please re-open and provide a sample app with details about your environment and what targets you're running on.