Exemple #1
0
        BindablePropertyContext GetOrCreateContext(BindableProperty property)
        {
            BindablePropertyContext context = GetContext(property);

            if (context == null)
            {
                context = CreateAndAddContext(property);
            }
            else if (property.DefaultValueCreator != null)
            {
                context.Value = property.DefaultValueCreator(this); //Update Value from dali
            }//added by xb.teng

            return(context);
        }
Exemple #2
0
        BindablePropertyContext CreateAndAddContext(BindableProperty property)
        {
            var context = new BindablePropertyContext {
                Property = property, Value = property.DefaultValueCreator != null?property.DefaultValueCreator(this) : property.DefaultValue
            };

            if (property.DefaultValueCreator == null)
            {
                context.Attributes = BindableContextAttributes.IsDefaultValue;
            }
            else
            {
                context.Attributes = BindableContextAttributes.IsDefaultValueCreated;
            }

            _properties.Add(context);
            return(context);
        }
Exemple #3
0
        BindablePropertyContext GetOrCreateContext(BindableProperty property)
        {
            BindablePropertyContext context = GetContext(property);

            if (context == null)
            {
                context = CreateAndAddContext(property);
            }
            else if (property.ValueGetter != null)
            {
                context.Value = property.ValueGetter(this);         //Update Value from dali
            }//added by xiaohui.fang
            else if (property.DefaultValueCreator != null)          //This will be removed in the future.
            {
                context.Value = property.DefaultValueCreator(this); //Update Value from dali
            }//added by xb.teng

            return(context);
        }