添加项目文件。
This commit is contained in:
49
MetroGauges/Controls/Table/Table.cs
Normal file
49
MetroGauges/Controls/Table/Table.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace MetroGauges.Controls
|
||||
{
|
||||
public class OutTable
|
||||
{
|
||||
private Canvas m_Canvas;
|
||||
private List<Row> rows = new List<Row>();
|
||||
|
||||
public List<FrameworkElement> DrawShaps { get; set; }
|
||||
|
||||
public int Cols { get; set; }
|
||||
|
||||
public List<Row> Rows { get { return rows; } }
|
||||
|
||||
public Point StartPoint { get; set; }
|
||||
|
||||
public OutTable(Canvas canvas)
|
||||
{
|
||||
m_Canvas = canvas;
|
||||
}
|
||||
|
||||
|
||||
public Row NewRow()
|
||||
{
|
||||
Row row = new Row(Cols, m_Canvas) { Table=this };
|
||||
rows.Add(row);
|
||||
return row;
|
||||
}
|
||||
|
||||
public void DrawTable()
|
||||
{
|
||||
for (int i = 0; i < this.rows.Count; i++)
|
||||
{
|
||||
this.rows[i].StartPoint = new Point() { X = this.StartPoint.X, Y = this.StartPoint.Y + this.rows[i].Height*i };
|
||||
this.rows[i].IntiCells();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user