Beispiel #1
0
        public ScenarioViewModel(Scenario scenario, StoryViewModel storyViewModel)
            : base(storyViewModel, true)
        {
            Scenario = scenario;

            ShouldDelete = false;

            CreateViewModels();

            repo = App.kernel.Get<IRepository>();
        }
Beispiel #2
0
        public void DeleteStory(StoryViewModel storyViewModel)
        {
            storyViewModel.IsSelected = false;

            storyViewModel.IsExpanded = false;

            Stories.Remove(storyViewModel.Story);

            Project.ChildrenIds.Remove(storyViewModel.Story.Id);

            base.Children.Clear();

            OnPropertyChanged("Stories");

            OnPropertyChanged("Children");

            repo.Delete<Story>(storyViewModel.Story);

            repo.Save<Project>(Project);
        }
Beispiel #3
0
        public void DeleteStory(StoryViewModel storyViewModel)
        {
            storyViewModel.ShouldDelete = true;

            var projectViewModel = ProjectViewModels.First(p => p.Children.Contains(storyViewModel));

            projectViewModel.DeleteStory(storyViewModel);
        }
Beispiel #4
0
        public void CreateStory()
        {
            var story = new Story() { ParentId = Project.Id };

            story.Name = "Name";

            Stories.Add(story);

            repo.Save<Story>(story);

            Project.ChildrenIds.Add(story.Id);

            var storyViewModel = new StoryViewModel(story, this) { IsSelected = true, IsExpanded = true };

            Children.Add(storyViewModel);

            Update();
        }