/// <summary> /// /// </summary> /// <param name="name"></param> /// <param name="style"></param> /// <param name="geometry"></param> /// <param name="isStroked"></param> /// <param name="isFilled"></param> /// <returns></returns> public static XPath Create( string name, ShapeStyle style, XPathGeometry geometry, bool isStroked = true, bool isFilled = true) { return new XPath() { Name = name, Style = style, IsStroked = isStroked, IsFilled = isFilled, Data = new Data() { Bindings = ImmutableArray.Create<ShapeBinding>(), Properties = ImmutableArray.Create<ShapeProperty>() }, Geometry = geometry }; }
private void InitializeWorkingPath(XPoint start) { _geometry = XPathGeometry.Create( new List<XPathFigure>(), _editor.Project.Options.DefaultFillRule); _geometry.BeginFigure( start, _editor.Project.Options.DefaultIsFilled, _editor.Project.Options.DefaultIsClosed); _path = XPath.Create( "Path", _editor.Project.CurrentStyleLibrary.CurrentStyle, _geometry, _editor.Project.Options.DefaultIsStroked, _editor.Project.Options.DefaultIsFilled); _editor.Project.CurrentContainer.WorkingLayer.Shapes = _editor.Project.CurrentContainer.WorkingLayer.Shapes.Add(_path); _previousPathTool = _editor.CurrentPathTool; _isInitialized = true; }
/// <summary> /// Creates a new instance of the XPath class. /// </summary> /// <param name="geometry"></param> /// <param name="isStroked"></param> /// <param name="isFilled"></param> /// <returns></returns> public XPath Path( XPathGeometry geometry, bool isStroked = true, bool isFilled = false) { var path = XPath.Create( "", Context.Editor.Project.CurrentStyleLibrary.CurrentStyle, geometry, isStroked, isFilled); Context.Editor.AddWithHistory(path); return path; }
private void DeInitializeWorkingPath() { _isInitialized = false; _geometry = null; _path = null; }