void AddNewLines(int count, CoordinateSystem coordinateSystem) { for (int i = 0; i < count; i++) { var newLine = new Line() { Visibility = this.Visible.ToVisibility() }; Canvas.SetZIndex(newLine, (int)ZOrder.Grid); Lines.Add(newLine); Drawing.Canvas.Children.Add(newLine); newLine.Apply(this.Style.GetWpfStyle()); } }