Example #1
0
        public StoryViewModel(Story story, ProjectViewModel projectViewModel)
            : base(projectViewModel, true)
        {
            Story = story;

            ShouldDelete = false;

            repo = App.kernel.Get<IRepository>();
        }
Example #2
0
        public void DeleteProject(ProjectViewModel projectViewModel)
        {
            projectViewModel.ShouldDelete = true;

            projectViewModel.IsSelected = false;

            projectViewModel.IsExpanded = false;

            projectViewModel.Children.Clear();

            ProjectViewModels.Remove(projectViewModel);

            repo.Delete<Project>(projectViewModel.Project);
        }
Example #3
0
        public void CreateProject()
        {
            var project = new Project();

            project.Name = "Name";

            var projectViewModel = new ProjectViewModel(project) { IsSelected = true, IsExpanded = true };

            ProjectViewModels.Add(projectViewModel);

            repo.Save<Project>(project);

            OnPropertyChanged("ProjectViewModels");
        }