Exemplo n.º 1
0
        public BookVM EditBookExternalTest(BookVM targetBook)
        {
            if (targetBook == null)
            {
                return(null);
            }
            EditBookWindowVM vm = new EditBookWindowVM(targetBook.Book)
            {
                Parent = this
            };

            vm.Init(null);
            EditBookWindow window  = new EditBookWindow(vm);
            BookVM         newBook = null;

            if (window.ShowDialog() == true)
            {
                newBook = new BookVM(vm.Book)
                {
                    Parent = this
                };
            }
            window.Content = null;
            return(newBook);
        }
Exemplo n.º 2
0
        private BookVM AddOrEditBook(Book book, BookRelation relation)
        {
            EditBookWindowVM vm = new EditBookWindowVM(book)
            {
                Parent = this
            };

            vm.Init(relation);
            EditBookWindow window = new EditBookWindow(vm);

            window.Owner = Application.Current.MainWindow;
            BookVM newBook = null;

            if (window.ShowDialog() == true)
            {
                newBook = new BookVM(vm.Book)
                {
                    Parent = this
                };
            }
            window.Content = null;
            return(newBook);
        }
Exemplo n.º 3
0
        private BookVM AddOrEditBook(Book book, BookRelation relation)
        {
            EditBookWindowVM vm = new EditBookWindowVM(book) { Parent = this };
            vm.Init(relation);
            EditBookWindow window = new EditBookWindow(vm);
            window.Owner = Application.Current.MainWindow;
            BookVM newBook = null;
            if (window.ShowDialog() == true)
            {
                newBook = new BookVM(vm.Book) { Parent = this };

            }
            window.Content = null;
            return newBook;
        }
Exemplo n.º 4
0
 public BookVM EditBookExternalTest(BookVM targetBook)
 {
     if (targetBook == null)
     {
         return null;
     }
     EditBookWindowVM vm = new EditBookWindowVM(targetBook.Book) { Parent = this };
     vm.Init(null);
     EditBookWindow window = new EditBookWindow(vm);
     BookVM newBook = null;
     if (window.ShowDialog() == true)
     {
         newBook = new BookVM(vm.Book) { Parent = this };
     }
     window.Content = null;
     return newBook;
 }