public Vector() { Line = new Segment(); // Line's dependencies established by OnDependenciesChanged() Line.Style = new LineStyle() { StrokeWidth = 0, Color = Colors.Transparent }; // Line is invisible Arrow = new Arrow(); Arrow.ZIndex = (int)ZOrder.Vectors; Arrow.Dependencies.Add(Line); Children.Add(Line, Arrow); ZIndex = (int)ZOrder.Vectors; }
public static MidPoint CreateMidPoint(Drawing Drawing, Segment segment) { return Factory.CreateMidPoint(Drawing, segment.Dependencies); }
private void AddSide() { var side = new Segment(); side.Drawing = Drawing; var index = sides.Count; if (index > 2) { sides[index - 1].Dependencies[1] = vertices[index - 1]; } if (index == 0) { side.Dependencies = new[] { this.Dependencies[1], vertices[0] }; } else if (index == NumberOfSides - 1) { side.Dependencies = new[] { vertices[NumberOfSides - 2], this.Dependencies[1] }; } else { side.Dependencies = new[] { vertices[index - 1], vertices[index] }; } sides.Add(side); Children.Add(side); if (Drawing != null) { side.OnAddingToCanvas(Drawing.Canvas); } }