예제 #1
0
        void MoveDown()
        {
            int itemIndex = AllBooks.IndexOf(SelectedBook);

            AllBooks.Move(itemIndex + 1, itemIndex);
            SelectedBook.BookID++;
            AllBooks[itemIndex].BookID--;
        }
예제 #2
0
        void MoveUp()
        {
            int itemIndex = AllBooks.IndexOf(SelectedBook);

            AllBooks.Move(itemIndex - 1, itemIndex);
            SelectedBook.BookID--;
            AllBooks[itemIndex].BookID++;
        }
예제 #3
0
 public bool MoveDownCanExecute()
 {
     if (SelectedBook == null)
     {
         return(false);
     }
     if (AllBooks.IndexOf(SelectedBook) == AllBooks.Count - 1)
     {
         return(false);
     }
     return(true);
 }
예제 #4
0
 public bool MoveUpCanExecute()
 {
     if (SelectedBook == null)
     {
         return(false);
     }
     if (AllBooks.IndexOf(SelectedBook) == 0)
     {
         return(false);
     }
     return(true);
 }