Exemplo n.º 1
0
        public override Path GetBaseObject(XElement element)
        {
            var pathObject             = new Path();
            var pathGeometryCollection = element.Elements("PathGeometry");
            var result = pathObject;

            foreach (var xElement in pathGeometryCollection)
            {
                var attribute = xElement.Attribute("Figures");

                var figuresAttribute = new FiguresAttribute(attribute.Value);
                result = figuresAttribute.TryApplyAttribute <Path>(result);
            }

            var fill = SvgElementService.GetBrushFromSvgStyleAttribute(element.Attribute("style"));

            if (fill == null)
            {
                fill = new SolidColorBrush(Colors.Black);
            }

            if (fill != Brushes.Transparent)
            {
                result.Fill = fill;
            }

            return(result);
        }
Exemplo n.º 2
0
        public override SvgGenericShapeAdaptor GetBaseObject(XElement element)
        {
            var shapeAdaptor = new SvgGenericShapeAdaptor();
            var fill         = SvgElementService.GetBrushFromSvgStyleAttribute(element.Attribute("style"));

            if (fill != null && fill != Brushes.Transparent)
            {
                shapeAdaptor.Fill = fill;
            }

            return(shapeAdaptor);
        }