Пример #1
0
        public static HitTestInfo CreateNewByDrag(XDrawing drawing, Point startPt, out XDrawingModes newMode)
        {
            var path = new Path();

            path.Stroke          = new SolidColorBrush(Colors.Black);
            path.StrokeThickness = 1.0;
            path.Data            = new EllipseGeometry(startPt, 0.0, 5.0);
            var          shape = new XDrawingEllipse(drawing, path);
            ControlPoint cp;

            shape.CreateControlPoints(false, out cp);
            //newMode = XDrawingModes.Select;
            newMode = XDrawingModes.Edit;
            var hti = new HitTestInfo();

            hti.Shape        = shape;
            hti.Offset       = new Vector(0.0, 0.0);
            hti.ControlPoint = cp;
            return(hti);
        }