Exemple #1
0
        internal void UnApply(BindableObject target, bool fromStyle = false)
        {
            if (target == null)
            {
                throw new ArgumentNullException(nameof(target));
            }
            if (Property == null)
            {
                return;
            }

            object actual = target.GetValue(Property);

            if (!Equals(actual, Value) && !(Value is Tizen.NUI.XamlBinding.Binding) && !(Value is DynamicResource))
            {
                //Do not reset default value if the value has been changed
                _originalValues.Remove(target);
                return;
            }

            object defaultValue;

            if (_originalValues.TryGetValue(target, out defaultValue))
            {
                //reset default value, unapply bindings and dynamicResource
                target.SetValue(Property, defaultValue, fromStyle);
                _originalValues.Remove(target);
            }
            else
            {
                target.ClearValue(Property);
            }
        }
 internal override void TearDown(BindableObject bindable)
 {
     bindable.RemoveBinding(_boundProperty);
     bindable.ClearValue(_boundProperty);
 }
Exemple #3
0
 internal override void TearDown(BindableObject bindable)
 {
     bindable.ClearValue(_stateProperty);
     bindable.PropertyChanged -= OnAttachedObjectPropertyChanged;
 }