summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorE.Z. Hart <hartez@gmail.com>2016-09-27 12:11:57 -0600
committerE.Z. Hart <hartez@gmail.com>2016-09-27 12:11:57 -0600
commit33b60324383b5424339119e432137b6d7d898fa8 (patch)
treee7a96d5df501d4198105df5a099d29246895ef7f
parent87a79d14aa28bf77b70ad889a37964202ed4a302 (diff)
parent1a86ca598e7af954a584226b1a7761ef3675d39e (diff)
downloadxamarin-forms-33b60324383b5424339119e432137b6d7d898fa8.tar.gz
xamarin-forms-33b60324383b5424339119e432137b6d7d898fa8.tar.bz2
xamarin-forms-33b60324383b5424339119e432137b6d7d898fa8.zip
Merge branch '2.3.3' of github.com:xamarin/Xamarin.Forms into 2.3.3
-rw-r--r--Xamarin.Forms.Core/BindingExpression.cs9
1 files changed, 8 insertions, 1 deletions
diff --git a/Xamarin.Forms.Core/BindingExpression.cs b/Xamarin.Forms.Core/BindingExpression.cs
index 5ce8cd87..71ba0512 100644
--- a/Xamarin.Forms.Core/BindingExpression.cs
+++ b/Xamarin.Forms.Core/BindingExpression.cs
@@ -409,6 +409,7 @@ namespace Xamarin.Forms
class WeakPropertyChangedProxy
{
WeakReference _source, _listener;
+ internal WeakReference Source => _source;
public WeakPropertyChangedProxy(INotifyPropertyChanged source, PropertyChangedEventHandler listener)
{
@@ -470,7 +471,13 @@ namespace Xamarin.Forms
public void Subscribe(INotifyPropertyChanged handler)
{
- // If we're reapplying, we don't want to double subscribe
+ if (ReferenceEquals(handler, _listener?.Source?.Target))
+ {
+ // Already subscribed
+ return;
+ }
+
+ // Clear out the old subscription if necessary
Unsubscribe();
_listener = new WeakPropertyChangedProxy(handler, _changeHandler);