private void AddTimeRectangle(double startTime, double endTime, Color color, int column)
{
const int columnWidth = 50;
Debug.WriteLine("Adding Rect {0} {1} {2}", startTime, endTime, color);
double left = column * (columnWidth * 2 / 3);
double height = endTime - startTime;
Rectangle r = new Rectangle()
{
Fill = new SolidColorBrush(color),
Width = columnWidth,
Height = height,
};
Canvas.SetLeft(r, left);
Canvas.SetTop(r, startTime);
theRootCanvas.Children.Add(r);
if (theRootCanvas.Height < endTime)
{
theRootCanvas.Height = endTime;
}
if (theRootCanvas.Width < left + columnWidth)
{
theRootCanvas.Width = left + columnWidth;
}
}
}