예제 #1
0
        public IEnumerable <UIElement> GetDrawing()
        {
            var DrawingElements = new List <UIElement>();

            foreach (var point in PointsList)
            {
                DrawingElements.Add(EllipseExtentions.CanvasPoint(point));
            }

            if (PointsList.Count > 0)
            {
                DrawingElements.Add(new Polyline()
                {
                    Points = new PointCollection(PointsList.Concat(new Point[] { PointsList.First() })), Stroke = Brushes.Black
                });
            }

            if (PointsList.Count() >= 3)
            {
                var path = MakeBezierPath(PointsList.ToArray());
                DrawingElements.Add(path);
            }

            return(DrawingElements);
        }