Bug 58049 - UWP: Update Image properties in ListView with DataBinding
Summary: UWP: Update Image properties in ListView with DataBinding
Status: CONFIRMED
Alias: None
Product: Forms
Classification: Xamarin
Component: Windows ()
Version: 2.3.4
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-07-10 14:56 UTC by fhoerdt
Modified: 2017-08-06 16:18 UTC (History)
5 users (show)

Tags: ac uwp listview viewcell image isvisible
Is this bug a regression?: ---
Last known good build:


Attachments
Example project (343.29 KB, application/x-zip-compressed)
2017-07-10 14:56 UTC, fhoerdt
Details


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 58049 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:
Status:
CONFIRMED

Description fhoerdt 2017-07-10 14:56:25 UTC
Created attachment 23448 [details]
Example project

I implemented a selectable and grouped ListView and it works well on every platform expect of Windows UWP, it seems to be a bug.
To check if an item in the ListView is checked, I decided to show a picture. I bound the IsVisible property of the image to another property in the ItemSource of the ListView. I wrote code that will change the IsVisible property of the object on which was clicked. The properties in the ItemSource changed but the Image won't get visible or invisible.

The properties of the Image in will be updated only at the first initialization of the object (Cell). To check if the property changed or not I create a CustomRenderer for Image and override the Method OnElementPropertyChanged, which is never called.
I noticed this problem occurred for the most properties in UWP Image.

I attached an example project to this bug.
Comment 1 Jimmy [MSFT] 2017-07-10 17:50:21 UTC
I can reproduce this issue using the attached project. I thought this might be threading issue so I tested using Device.BeginInvokeOnMainThread() when updating Image.IsVisible, but that did not help resolve the issue. I am confirming the report so we can investigate further.


### Version Tests
2.3.6.117   BAD
2.3.5-pre6  BAD
2.3.4.247   BAD
Comment 2 Jeff 2017-07-25 08:55:10 UTC
This also happens with just a plan Label (2.3.4.247). I have bound Label.Text to a property on my object. When I change the property I expect the text to change on the Label. It does on Android but on UWP the Label simply goes blank. In the ListView, the workarounds in this:

https://forums.xamarin.com/discussion/58266/binding-update-become-blank-on-uwp

do help. But I am using the third party FlowListView in order to get a wrapping horizontal list view and its completely broken.
Right at the moment I'm screwed. I am going to have to give up the data binding and go back to adding my own Views to a StackLayout and manually manage the changes.
Comment 3 TomB 2017-07-27 13:49:25 UTC
Having the same problem with updating a Button Text of a ListView Item with DataTrigger binded to a bool attribute:

https://forums.xamarin.com/discussion/100283/listview-item-not-updateing-correctly-on-uwp/p1?new=1
Comment 4 Nicholas Bauer 2017-08-06 16:18:38 UTC
This might be a more general issue. I have a control in which I'm trying to update the size of BoxViews inside an AbsoluteLayout inside a ViewCell. It works properly when not contained in a ViewCell via binding to a parent property. Rarely, a ViewCell will generate with the properties updated by binding, but it appears to be semirandom. If I try to explicitly update the properties via a button, the visual for the ViewCell doesn't update, even though it appears that the property changed handlers do propagate the values correctly.