Bug 60459 - Setter not hit for BindableProperty if value set from XAML
Summary: Setter not hit for BindableProperty if value set from XAML
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 2.4.0
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2017-10-31 20:42 UTC by Harikrishnan
Modified: 2017-11-01 07:13 UTC (History)
6 users (show)

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

Sample replicating the reported issue (304.06 KB, application/x-zip-compressed)
2017-10-31 20:42 UTC, Harikrishnan

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 Harikrishnan 2017-10-31 20:42:55 UTC
Created attachment 25523 [details]
Sample replicating the reported issue

Hi Team,

The setter of a property of my CustomView is not hit if i assign a value to that property from the XAML.

My requirement is to assign value to a bool field in the setter of the property, so that based on that condition, i can perform some actions in the code. Please refer the attached sample for replication procedure.

I have a Custom View with a BindableProperty. Inside the setter of the property, i have set value to a bool field. Based on this value of the bool field i have performed code flow in my app. However since the setter of the property is not hit, i am ending up with wrong values for the bool property due to which my code flow diverges.
Comment 1 Paul DiPietro [MSFT] 2017-10-31 21:57:34 UTC
Setting the value in XAML doesn't invoke the property's setter. Refer to this SO answer for reference:


"The property, and the property accessors, are only meant to be invoked when accessing the property by code. C# code."