Ejemplo n.º 1
0
 public void MoveItemDown()
 {
     if (SelectedTreeViewItem is CategoryViewModel)
     {
         CategoryViewModel vm = SelectedTreeViewItem as CategoryViewModel;
         SubItems.MoveItemDown(vm);
     }
     else if (SelectedTreeViewItem is StoryViewModel)
     {
         StoryViewModel vm = SelectedTreeViewItem as StoryViewModel;
         if (vm.Model.CategoryId == null)
         {
             SubItems.MoveItemDown(vm);
         }
         else
         {
             CategoryViewModel category = Categories.Single(i => i.Model.id == vm.Model.CategoryId);
             category.Stories.MoveItemDown(vm);
         }
     }
     else if (SelectedTreeViewItem is ChapterViewModel)
     {
         ChapterViewModel vm = SelectedTreeViewItem as ChapterViewModel;
         vm.StoryVm.Chapters.MoveItemDown(vm);
     }
     else if (SelectedTreeViewItem is SceneViewModel)
     {
         SceneViewModel vm = SelectedTreeViewItem as SceneViewModel;
         vm.ChapterVm.Scenes.MoveItemDown(vm);
     }
 }