public AddBookWindow() { InitializeComponent(); var bookControl = new BookFormControl("Dodaj książkę", "Dodaj", new Book()); bookControl.ButtonCommand = new AddBookCommand(); this.Content = bookControl; }
public EditBookWindow(Book book) { InitializeComponent(); var bookControl = new BookFormControl("Edytuj książkę", "Zapisz", book); bookControl.ButtonCommand = new EditBookCommand(); bookControl.ConfirmButton.Click += (sender, args) => { var bookView = bookControl.BookView; Book book = Mapper.Instance.Map <Book>(bookView); BookEdited?.Invoke(this, new EntityEventArgs <Book> { Entity = book }); Hub.Instance.Publish(new EditBookMessage { BookView = bookView }); }; Content = bookControl; }