Ejemplo n.º 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.Binding.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);
            }
        }
Ejemplo n.º 2
0
 internal override void TearDown(BindableObject bindable)
 {
     bindable.ClearValue(stateProperty);
     bindable.PropertyChanged -= OnAttachedObjectPropertyChanged;
 }
Ejemplo n.º 3
0
 internal override void TearDown(BindableObject bindable)
 {
     bindable.RemoveBinding(boundProperty);
     bindable.ClearValue(boundProperty);
 }