void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.ThisWindow = ((WPFLibrary.BookWindow)(target)); return; case 2: this.titleTb = ((System.Windows.Controls.TextBox)(target)); return; case 3: this.authorTb = ((System.Windows.Controls.TextBox)(target)); return; case 4: this.yearTb = ((System.Windows.Controls.TextBox)(target)); #line 48 "..\..\BookWindow.xaml" this.yearTb.PreviewTextInput += new System.Windows.Input.TextCompositionEventHandler(this.PreviewYearInput); #line default #line hidden return; } this._contentLoaded = true; }
private void BooksListView_MouseDoubleClick(object sender, MouseButtonEventArgs e) { ListView listView = sender as ListView; Book selected = listView.SelectedItem as Book; BookWindow window = new BookWindow(selected); window.Title = "Edit Book"; window.ShowDialog(); //refilter collectionViewSource.View.Filter = Filter; }
private void AddBtn_Click(object sender, RoutedEventArgs e) { BookWindow window = new BookWindow(); window.Title = "Insert New Book"; window.ShowDialog(); if (window.OKFlag) { Book newBook = window.Book; books.Add(new Book(newBook.Author, newBook.Title, newBook.Year)); //refilter collectionViewSource.View.Filter = Filter; } }
public void Execute(object parameter) { BookWindow window = parameter as BookWindow; window.Close(); }