Пример #1
0
        public ProjectViewModel(IProjectRepository projectRepository) {
            Activities = projectRepository.GetActivities();

            ActivitiesCVS = new CollectionViewSource();
            var groups = Activities
                .OrderBy(i => i.Project)
                .GroupBy(i => i.Project)
                .Select(g => new { GroupName = g.Key, Items = g });
            ActivitiesCVS.Source = groups;
            ActivitiesCVS.IsSourceGrouped = true;
            ActivitiesCVS.ItemsPath = new PropertyPath("Items");
            ActivitiesCollectionView = ActivitiesCVS.View;
        }