private void DrawYearLine(int year) { YearControl yearControl = new YearControl(); yearControl.DataContext = new YearItem() { Year = year }; Canvas.SetLeft(yearControl, 400 * year - 150); Binding binding = new Binding("ActualHeight"); binding.Source = canvas; yearControl.SetBinding(HeightProperty, binding); canvas.Children.Add(yearControl); }
void Start() { points = new List <MapLocation>(); foreach (Transform child in transform) { if (child.name == "points") { foreach (Transform point in child) { points.Add(point.GetComponent <MapLocation>()); } } else if (child.name == "notebook") { year = child.GetChild(0).GetChild(0).GetComponent <YearControl>(); month = child.GetChild(0).GetChild(1).GetComponent <MonthControl>(); } } }