Bug 59133 - Bound IsVisible Not working in ListView on Android
Summary: Bound IsVisible Not working in ListView on Android
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 2.4.0
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2017-08-31 03:26 UTC by Ryan Alford
Modified: 2017-12-01 00:48 UTC (History)
3 users (show)

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

Testing application that shows issue. (61.67 KB, application/zip)
2017-08-31 03:26 UTC, Ryan Alford

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 59133 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 Ryan Alford 2017-08-31 03:26:49 UTC
Created attachment 24494 [details]
Testing application that shows issue.

I am running into an issue with a Xamarin Forms application I have. The issue only happens on Android. The iOS version works as expected.

I have a ListView with a custom data template. The data in the data template is bound to a model collection that's on the view model that's set as the BindingContext of the view. The data template has an image(a checkmark) that should show when the user taps on the row. I am using a bound "IsSelected" property on my model for the IsVisible value of the image.

On iOS, the image shows and hides correctly(clicking on the row a second time will hide the image). But on Android, the image never shows.

I've tried a number of different ways to get the collection of data to update, but just can't get it to work.

I have attached a sample project that shows the issue. I'm testing on Android 7.1.
Comment 1 Paul DiPietro [MSFT] 2017-08-31 18:11:15 UTC
There was a minor hiccup with the file not being found due to location, but using any placeholder image should work. I've also tested the project on 2.4.0-pre2 and the nightly build where the issue still exists.
Comment 2 Ryan Alford 2017-09-07 14:19:42 UTC
So is the issue with the IsVisible binding not working? Or is the image not being found correctly?
Comment 3 Ryan Alford 2017-09-15 22:16:41 UTC
Is there any work around available? This is a pretty large issue for my application. I've tried other options, like setting the background color of the row when it's clicked(using a Binding for background color that's bound to my model), and that doesn't work either. It seems that changing the data on Android through a binding just doesn't work.

I'm just looking for some help on how to get around this. I just need to show some type of visual clue that the user has selected a row. Multiple rows can be selected at a time, and clicking on a previously selected row should unselect the row.