private void ReconstruirDatos() { DateTime[] days = Min.For(d => d <= Max, d => d.AddDays(1)).ToArray(); icYears.ItemsSource = days.GroupCount(a => a.Year).Select(p => new YearGroup { Year = p.Key, Count = p.Value }).ToList(); icMonths.ItemsSource = days.GroupCount(a => new { a.Month, a.Year }).Select(p => new MonthGroup { Month = p.Key.Month, Year = p.Key.Year, Count = p.Value }).ToList();; icDays.ItemsSource = days.Select(a => new Day { Value = a }).ToList(); }
private void ReconstruirDatos() { DateTime[] days = Min.For(d => d <= Max, d => d.AddDays(1)).ToArray(); icYears.ItemsSource = days.GroupCount(a => a.Year).Select(p => new YearGroup { Year = p.Key, Count = p.Value }).ToObservableCollection(); var months = days.GroupCount(a => new { a.Month, a.Year }).Select(p => new MonthGroup { Month = p.Key.Month, Year = p.Key.Year, Count = p.Value }).ToObservableCollection(); icMonthsDown.ItemsSource = months; icMonthsUp.ItemsSource = months; icDays.ItemsSource = days.Select(a => new Day { Value = a }).ToObservableCollection(); icWeeks.ItemsSource = days.GroupCount(d => GetWeek(d)).Select(p => new WeekGroup { Min = p.Key.min.Day, Max = p.Key.max.Day, Count = p.Value }).ToObservableCollection(); }