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;
        }
Exemple #2
0
 protected virtual void OnBookEdited(Book b)
 {
     BookEdited?.Invoke(this, new BookEventArgs(b));
 }