//public Speaker Person //{ // get => person; // set // { // person = value; // UpdateCalendar(); // } //} private void LoadYear(int year) { yearLabel.Content = year; _calendar.Clear(); flowLayout.Children.Clear(); _year = year; var start = Core.Helper.GetConregationDay(new DateTime(year, 1, 1)); if (start.Year < year) { start = start.AddDays(7); } var currentMonth = 0; while (start.Year == year) { CalendarYearShortItem item; if (start.Month != currentMonth) { item = new CalendarYearShortItem(start.Month); FlowLayoutControl.SetIsFlowBreak(item, true); flowLayout.Children.Add(item); _calendar.Add(new DateTime(1900, start.Month, 1), item); currentMonth = start.Month; } item = new CalendarYearShortItem(start); flowLayout.Children.Add(item); _calendar.Add(start, item); start = start.AddDays(7); } UpdateCalendar(); }
public CalendarYearShortViewModel() { Calendar = new List <CalendarYearShortItem>(53); var start = Core.Helper.GetConregationDay(new DateTime(Core.Helper.DisplayedYear, 1, 1)); while (start.Year == Core.Helper.DisplayedYear) { var item = new CalendarYearShortItem(start); Calendar.Add(item); start = start.AddDays(7); } //dxlc:FlowLayoutControl.IsFlowBreak="True" }