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

            ShouldDelete = false;

            CreateViewModels();

            repo = App.kernel.Get<IRepository>();
        }
예제 #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);
        }
예제 #3
0
        public void DeleteStory(StoryViewModel storyViewModel)
        {
            storyViewModel.ShouldDelete = true;

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

            projectViewModel.DeleteStory(storyViewModel);
        }
예제 #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();
        }