Bug 37169 - OnElementPropertyChanged is called twice for my property change
Summary: OnElementPropertyChanged is called twice for my property change
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 2.0.0
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Paul DiPietro [MSFT]
Depends on:
Reported: 2015-12-20 14:03 UTC by Mike
Modified: 2017-06-19 21:03 UTC (History)
8 users (show)

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

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 Mike 2015-12-20 14:03:31 UTC
I've got a custom control that uses the following property:

        public static readonly BindableProperty ProgressStringsProperty =
            BindableProperty.Create<CoreProgress, List<ProgressString>>(
                p => p.ProgressStrings, default(List<ProgressString>));

        public List<ProgressString> ProgressStrings
            get { return (List<ProgressString>)GetValue(ProgressStringsProperty); }
            set { SetValue(ProgressStringsProperty, value); }

When I set ProgressStrings equal to a new list of ProgressString, the OnElementPropertyChanged is called twice.

I just updated to the latest and greatest Xamarin Forms in all my projects.
Comment 1 Mike 2015-12-27 16:36:50 UTC
I tried to generate a test project to reproduce this for you, but my test project has some other bug in it.
Comment 2 Paul DiPietro [MSFT] 2016-01-11 20:40:08 UTC
We would need more info here and possibly a project if it can be provided at some point. It's possible that something is double subscribed leading to the OnElementPropertyChanged being called twice.
Comment 3 adrianknight89 2016-09-24 04:30:41 UTC
I faced a similar problem where property changed events were firing twice for bindable properties. The solution for me was to handle property changed notifications in the bindable property declaration.

Look at the syntax for BindableProperty.Create(). You can attach a handler as a parameter.
Comment 4 Chris King 2017-06-19 17:09:21 UTC
Assigned to you as you were last to requeste info for this bug.
Comment 5 Samantha Houts [MSFT] 2017-06-19 21:03:40 UTC
Because we have not received a reply to our request for more information we are closing this issue. If you are still encountering this issue, please reopen the ticket with the requested information. Thanks!