Esempio n. 1
0
        private PropertyValue GetTransformMap()
        {
            var transformMap = new PropertyMap();

            if (!noOffset.Equals(Offset))
            {
                var temp = new Vector2((int)VisualTransformPolicyType.Absolute, (int)VisualTransformPolicyType.Absolute);
                transformMap[(int)VisualTransformPropertyType.OffsetPolicy] = new PropertyValue(temp);
                transformMap[(int)VisualTransformPropertyType.Offset]       = PropertyValue.CreateWithGuard(Offset);
                temp.Dispose();
            }

            if (!noExtents.Equals(Extents))
            {
                transformMap[(int)VisualTransformPropertyType.ExtraSize] = PropertyValue.CreateWithGuard(Extents);
            }

            transformMap[(int)VisualTransformPropertyType.Origin]      = new PropertyValue((int)Visual.AlignType.Center);
            transformMap[(int)VisualTransformPropertyType.AnchorPoint] = new PropertyValue((int)Visual.AlignType.Center);

            var ret = new PropertyValue(transformMap);

            transformMap.Dispose();
            return(ret);
        }
Esempio n. 2
0
        protected override PropertyMap GetPropertyMap()
        {
            var map = base.GetPropertyMap();

            map[Visual.Property.Type] = new PropertyValue((int)Visual.Type.Image);

            if (Rectangle.IsNullOrZero(Border))
            {
                map[Visual.Property.Type] = new PropertyValue((int)Visual.Type.Image);
            }
            else
            {
                map[Visual.Property.Type] = new PropertyValue((int)Visual.Type.NPatch);
            }

            map[ImageVisualProperty.Border] = PropertyValue.CreateWithGuard(Border);

            string urlString = Url;

            if (Url.StartsWith("*Resource*"))
            {
                string resource = Tizen.Applications.Application.Current.DirectoryInfo.Resource;
                urlString = Url.Replace("*Resource*", resource);
            }

            map[ImageVisualProperty.URL] = PropertyValue.CreateWithGuard(urlString);

            return(map);
        }
Esempio n. 3
0
        internal TextShadow(TextShadow other)
        {
            propertyMap = new PropertyMap();

            Color = other.Color;
            propertyMap["color"] = PropertyValue.CreateWithGuard(Color);

            Offset = other.Offset;
            propertyMap["offset"] = PropertyValue.CreateWithGuard(Offset);

            BlurRadius = other.BlurRadius;
            propertyMap["blurRadius"] = new PropertyValue(BlurRadius);
        }
Esempio n. 4
0
        public TextShadow(Color color, Vector2 offset, float blurRadius)
        {
            propertyMap = new PropertyMap();

            Color = color;
            propertyMap["color"] = PropertyValue.CreateWithGuard(Color);

            Offset = offset;
            propertyMap["offset"] = PropertyValue.CreateWithGuard(Offset);

            BlurRadius = blurRadius;
            propertyMap["blurRadius"] = new PropertyValue(BlurRadius);
        }
Esempio n. 5
0
        private void UpdateBorder()
        {
            if (Rectangle.IsNullOrZero(border))
            {
                propertyMap[Visual.Property.Type] = new PropertyValue((int)Visual.Type.Image);
            }
            else
            {
                propertyMap[Visual.Property.Type] = new PropertyValue((int)Visual.Type.NPatch);
            }

            propertyMap[ImageVisualProperty.Border] = PropertyValue.CreateWithGuard(border);
            OnPropertyChanged?.Invoke(this);
        }
Esempio n. 6
0
        internal TextShadow(TextShadow other, PropertyChangedCallback callback = null)
        {
            propertyMap = new PropertyMap();

            Color = other.Color;
            propertyMap["color"] = PropertyValue.CreateWithGuard(Color);

            Offset = other.Offset;
            propertyMap["offset"] = PropertyValue.CreateWithGuard(Offset);

            BlurRadius = other.BlurRadius;
            propertyMap["blurRadius"] = new PropertyValue(BlurRadius);

            OnPropertyChanged = callback;
        }
Esempio n. 7
0
        private PropertyValue GetTransformMap()
        {
            var transformMap = new PropertyMap();

            if (!offset.Equals(noOffset))
            {
                transformMap[(int)VisualTransformPropertyType.OffsetPolicy] = new PropertyValue(absoluteTransformPolicy);
                transformMap[(int)VisualTransformPropertyType.Offset]       = PropertyValue.CreateWithGuard(offset);
            }

            if (!scale.Equals(noScale))
            {
                transformMap[(int)VisualTransformPropertyType.Size] = PropertyValue.CreateWithGuard(scale);
            }

            return(transformMap.Count() == 0 ? new PropertyValue() : new PropertyValue(transformMap));
        }
Esempio n. 8
0
        private PropertyValue GetTransformMap()
        {
            var transformMap = new PropertyMap();

            if (!Offset.Equals(noOffset))
            {
                transformMap[(int)VisualTransformPropertyType.OffsetPolicy] = new PropertyValue(new Vector2((int)VisualTransformPolicyType.Absolute, (int)VisualTransformPolicyType.Absolute));
                transformMap[(int)VisualTransformPropertyType.Offset]       = PropertyValue.CreateWithGuard(Offset);
            }

            if (!Extents.Equals(noExtents))
            {
                transformMap[(int)VisualTransformPropertyType.ExtraSize] = PropertyValue.CreateWithGuard(Extents);
            }

            return(transformMap.Count() == 0 ? new PropertyValue() : new PropertyValue(transformMap));
        }
Esempio n. 9
0
        protected override PropertyMap GetPropertyMap()
        {
            var map = base.GetPropertyMap();

            map[Visual.Property.Type] = new PropertyValue((int)Visual.Type.Image);

            if (Rectangle.IsNullOrZero(Border))
            {
                map[Visual.Property.Type] = new PropertyValue((int)Visual.Type.Image);
            }
            else
            {
                map[Visual.Property.Type] = new PropertyValue((int)Visual.Type.NPatch);
            }

            map[ImageVisualProperty.Border] = PropertyValue.CreateWithGuard(Border);

            map[ImageVisualProperty.URL] = PropertyValue.CreateWithGuard(Url);

            return(map);
        }
Esempio n. 10
0
        private PropertyValue GetTransformMap(BaseComponents.View attachedView)
        {
            var transformMap = new PropertyMap();

            if (!offset.Equals(noOffset))
            {
                transformMap[(int)VisualTransformPropertyType.OffsetPolicy] = new PropertyValue(absoluteTransformPolicy);
                transformMap[(int)VisualTransformPropertyType.Offset]       = PropertyValue.CreateWithGuard(offset);
            }

            if (!extents.Equals(noExtents))
            {
                var viewSize   = new Vector2(attachedView.GetRelayoutSize(DimensionType.Width), attachedView.GetRelayoutSize(DimensionType.Height));
                var shadowSize = viewSize + extents;

                transformMap[(int)VisualTransformPropertyType.SizePolicy] = new PropertyValue(absoluteTransformPolicy);
                transformMap[(int)VisualTransformPropertyType.Size]       = PropertyValue.CreateWithGuard(shadowSize);
            }

            return(transformMap.Count() == 0 ? new PropertyValue() : new PropertyValue(transformMap));
        }
Esempio n. 11
0
 private void UpdateColor()
 {
     propertyMap[ColorVisualProperty.MixColor] = PropertyValue.CreateWithGuard(color);
     OnPropertyChanged?.Invoke(this);
 }
Esempio n. 12
0
 private void UpdateBorder()
 {
     propertyMap[ImageVisualProperty.Border] = PropertyValue.CreateWithGuard(border);
     OnPropertyChanged?.Invoke(this);
 }
Esempio n. 13
0
 private void UpdateUrl()
 {
     propertyMap[ImageVisualProperty.URL] = PropertyValue.CreateWithGuard(url);
     OnPropertyChanged?.Invoke(this);
 }