Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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.
In XF 2.3.4 as part of the work to compile data triggers, it apppears setter functionality is broken in some cases.
When using a DataTrigger to set an image Source, the setter does not fire correctly. This may be similar to the behavior reported in #32896 and #42044. I believe this may be related to the work done in PR #648 and possibly PR #737.
Please see repro projects which demo working data trigger in 184.108.40.206 and broken in 220.127.116.11.
Note: For the repro projects, image assets included for Droid only so please test on Droid.
Created attachment 22207 [details]
Working on XF 18.104.22.168
Created attachment 22208 [details]
Broken on XF 22.214.171.124
Thanks for the reproductions. The issue also still occurs on 126.96.36.199. Updating to mark this as a regression.
Thanks Paul. Will this be addressed in XF 2.3.5?
I faced the same problem at 188.8.131.52-pre3 - DataTrigger working randomly. At 184.108.40.206 it's working fine.
For me it's again CRITIAL issue.. again, as whole XF. Each update, new issues.
Paul - are you able to give us an update on this issue? Can we expect to see a fix in XF 2.3.5 or even better a hot-fix on 2.3.4?
Bumping up the priority since this is a regression that is still present in recent versions.
Regression still exists in XF 2.3.5-pre5.
I'm really hoping this will be fixed before XF 2.3.5-stable?
Yep, for me at pre5 it's working at as pre3 - issue still exist.
Any comment from XF team? Any chance for fix in stable 2.3.5?
We're looking into this.
Any update? It a month has passed... and it's still **High blocker**.
Created attachment 23855 [details]
I discussed this issue with the team and we determined that this is not a bug. The Image in the repro project has two DataTriggers attached that get fired and each change the Binding for the Source property. Even though this may have worked in previous versions, the behavior cannot be expected to be consistent for this kind of scenario. We cannot guarantee the order that the Binding changes will be applied and it may result in a broken state as seen here.
One recommended approach is to bind Image.Source to a single property and update that binding when IsSelected is changed. This would eliminate the need for DataTriggers on the Image. Alternatively, you can set Image.Source to a default file name or binding and continue using a single DataTrigger that changes the Source. When the DataTrigger condition is not met, the Image will then use the default Source.
I've attached a modified version of the repro project that demonstrates both these methods. Hope this helps!
Thanks Jimmy. A couple of months back we went with the first workaround you mentioned and bind to a single property and update when IsSelected is changed.
However, I feel we may need to re-open this issue as this is not the only case where DataTriggers are failing in XF 2.3.4 and above.
Just as a small note, could this limitation please be added to the docs? If it is not supported using multiple triggers on a Image source, then this needs to be documented. Do similar limitations exist for other views and properties? This all would be useful information.
Well, that's really strange.
It's it default understanding of .NET **DataTriggers**, that it's possible to set some property to *X*, but set it also to *Y*, based on **DataTriggers** contition?
I've multiple places in my app, where I'm doing it in that way...
I see something similar here - https://bugzilla.xamarin.com/show_bug.cgi?id=30074 - where same property could be set with three different values.
I also dissagree with proposed "workaround" to set some property value "at start" and handle only *True* condition. What if there is enum with 3 or more values, and we want our control, to be different for each of them (by setting same property to different value, based on differnet enums)?
@Matthew please do reopen with a repro and a specific case. The title on this issue is overly broad and we need to get to specific cases.
Agree, we will have docs update with more guidance around DataTriggers.
@Namyslaw sounds like your enum case is a candidate for a value converter (you could pass in values for each case), or having a proxy getter on your VM that does this logic.
The issue with binding multiple triggers to a single property is that the trigger's set/unset methods are async and as such cannot be predicted to maintain order when bound to the same property.
If you have specific cases for DataTriggers not working, please open independent Bugzilla reports so we can work with concrete examples and reproductions.