public MainWindowViewModel(CanvasZoomViewModel canvasZoomViewModel)
        {
            this.ZoomViewModel = canvasZoomViewModel;
            var projectViewModel   = new ProjectViewModel();
            var iterationViewModel = new IterationViewModel();

            projectViewModel.Iterations.Add(_selectedIteration);

            _selectedIteration = iterationViewModel;
            _selectedProject   = projectViewModel;
        }
Beispiel #2
0
        private void CreateFakeData(ApplicationDataStore applicationDataStore)
        {
            var projectViewModel = new ProjectViewModel
            {
                Name = "Bell"
            };
            var storycard1 = new StorycardViewModel()
            {
                Role     = "DEV",
                Title    = "My Storycard",
                Estimate = 16
            };
            var storycard2 = new StorycardViewModel()
            {
                Role     = "DEV",
                Title    = "My Storycard",
                Estimate = 16
            };

            projectViewModel.Storycards.Add(storycard1);
            projectViewModel.Storycards.Add(storycard2);

            var iterationViewModel = new IterationViewModel()
            {
                EndDate         = new DateTime(2016, 7, 7),
                IterationNumber = 4,
            };

            iterationViewModel.Storycards.Add(new PlacedStorycardViewModel(storycard1));
            var planningSheetViewModel = new PlanningSheetViewModel
            {
                Role  = "DEV",
                Color = Brushes.Green
            };

            planningSheetViewModel.PlannedCards.Add(new PlacedStorycardViewModel(storycard2));

            iterationViewModel.PlanningSheets.Add(planningSheetViewModel);

            projectViewModel.Iterations.Add(iterationViewModel);


            applicationDataStore.SelectedIteration = iterationViewModel;
            applicationDataStore.Project           = projectViewModel;
        }
 private void SelectedIteration_PropertyChange(object sender, PropertyChangedEventArgs e)
 {
     if (e.PropertyName.Equals("SelectedIteration"))
     {
         if (_previouslySelectedIteration != null)
         {
             _previouslySelectedIteration.PlanningSheets.CollectionChanged -= _planningSheetHandler.OnCollectionChange;
             _previouslySelectedIteration.Storycards.CollectionChanged     -= _storycardHandler.OnCollectionChange;
         }
         _planningSheetHandler.Clear();
         _storycardHandler.Clear();
         ViewModel.SelectedIteration.PlanningSheets.CollectionChanged += _planningSheetHandler.OnCollectionChange;
         ViewModel.SelectedIteration.Storycards.CollectionChanged     += _storycardHandler.OnCollectionChange;
         foreach (PlanningSheetViewModel planningSheetViewModel in ViewModel.SelectedIteration.PlanningSheets)
         {
             _planningSheetHandler.AddToCanvas(planningSheetViewModel);
         }
         foreach (PlacedStorycardViewModel storycard in ViewModel.SelectedIteration.Storycards)
         {
             _storycardHandler.AddToCanvas(storycard);
         }
         _previouslySelectedIteration = ViewModel.SelectedIteration;
     }
 }
Beispiel #4
0
 public SelectIterationViewModel(ObservableCollection <IterationViewModel> iterations, IterationViewModel selectedIteration)
 {
     Iterations        = iterations;
     SelectedIteration = selectedIteration;
 }