/// <summary>
        /// Updates the Sprint plans.
        /// </summary>
        private void UpdateSprintPlans()
        {
            if(Project==null || Project.Sprints==null || Items==null)
                return;

            // if has no sprints, create one
            if (Project.Sprints.Count == 0)
                CreateNewSprint();

            // create a new sprintplan collection
            if (SprintPlans != null)
                SprintPlans.ClearAndDispose();
            SprintPlans = new ObservableCollection<SprintViewModel>();

            int sprintNumber = 1;
            if (!ShowAllSprints)
                sprintNumber = Project.CurrentValidSprint.SprintNumber;
            foreach (Sprint s in Project.Sprints.Where(s => s.SprintNumber >= sprintNumber).OrderBy(s => s.SprintNumber)) {
                SprintViewModel sp = new SprintViewModel(projectsService, executor, aggregator, s, Items, SFConfig, calendar);
                SprintPlans.Add(sp);
            }

            OnPropertyChanged("SprintPlans");

            LateItemsSprint = new SprintViewModel(projectsService, executor, aggregator, null, Items, SFConfig, calendar);

            //NotFinishedItems = Items.Where(
            //    vm => (vm.Item.Status != (short)BacklogItemStatus.ITEM_DONE
            //        && vm.Item.Status != (short)BacklogItemStatus.ITEM_CANCELED
            //        && vm.Item.SprintNumber < Project.CurrentValidSprint.SprintNumber) || vm.Item.SprintNumber==null).ToList();

            //OnPropertyChanged("NotFinishedItems");
        }
 private void RemoveSprint(SprintViewModel sprintVM)
 {
     executor.StartBackgroundTask(
         () => {
             projectsService.RemoveSprint(sprintVM.Sprint.ProjectUId, sprintVM.Sprint.SprintUId);
             return projectsService.GetProject(Project.ProjectUId);
         },
         p => {
             SprintPlans.Remove(sprintVM);
             sprintVM.Dispose();
             // ugly, ugly
             aggregator.Publish<Project>(ScrumFactoryEvent.ViewProjectDetails, p);
         });
 }