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