public StoryViewModel(Story story, ProjectViewModel projectViewModel) : base(projectViewModel, true) { Story = story; ShouldDelete = false; repo = App.kernel.Get<IRepository>(); }
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); }
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"); }