diff options
author | Stephane Delcroix <stephane@delcroix.org> | 2017-04-06 23:13:49 +0200 |
---|---|---|
committer | Jason Smith <jason.smith@xamarin.com> | 2017-04-06 14:13:49 -0700 |
commit | 0ee636003b6d1083ea4caeed85ef3efbc815ed06 (patch) | |
tree | 861ba1a66b1b72be663719437ace87179cd3c03d /Xamarin.Forms.Core | |
parent | eb3db860e47da2974bddf6f0f959799f12e962c5 (diff) | |
download | xamarin-forms-0ee636003b6d1083ea4caeed85ef3efbc815ed06.tar.gz xamarin-forms-0ee636003b6d1083ea4caeed85ef3efbc815ed06.tar.bz2 xamarin-forms-0ee636003b6d1083ea4caeed85ef3efbc815ed06.zip |
Fix 54334 (#855)
* [C] unset the FromStyle flag on manual setting
* [C] Do not reset overriden values to default
* complete the fix
Diffstat (limited to 'Xamarin.Forms.Core')
-rw-r--r-- | Xamarin.Forms.Core/BindableObject.cs | 5 | ||||
-rw-r--r-- | Xamarin.Forms.Core/Setter.cs | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/Xamarin.Forms.Core/BindableObject.cs b/Xamarin.Forms.Core/BindableObject.cs index e87282d9..35e3648f 100644 --- a/Xamarin.Forms.Core/BindableObject.cs +++ b/Xamarin.Forms.Core/BindableObject.cs @@ -363,9 +363,10 @@ namespace Xamarin.Forms value = property.CoerceValue(this, value); BindablePropertyContext context = GetOrCreateContext(property); - if (manuallySet) + if (manuallySet) { context.Attributes |= BindableContextAttributes.IsManuallySet; - else + context.Attributes &= ~BindableContextAttributes.IsSetFromStyle; + } else context.Attributes &= ~BindableContextAttributes.IsManuallySet; if (fromStyle) diff --git a/Xamarin.Forms.Core/Setter.cs b/Xamarin.Forms.Core/Setter.cs index ea58d4fd..07bef633 100644 --- a/Xamarin.Forms.Core/Setter.cs +++ b/Xamarin.Forms.Core/Setter.cs @@ -63,12 +63,12 @@ namespace Xamarin.Forms internal void UnApply(BindableObject target, bool fromStyle = false) { if (target == null) - throw new ArgumentNullException("target"); + throw new ArgumentNullException(nameof(target)); if (Property == null) return; object actual = target.GetValue(Property); - if (!fromStyle && !Equals(actual, Value)) + if (!Equals(actual, Value) && !(Value is Binding) && !(Value is DynamicResource)) { //Do not reset default value if the value has been changed _originalValues.Remove(target); |