private void button_Click(object sender, RoutedEventArgs e) { Button btn = (Button)sender; var name = btn.Tag.ToString(); #region 根据按钮进行功能跳转 if (name == "add") { Add add = new Add(); add.ShowDialog(); return; } else if (name == "query") { SearchRes res = new SearchRes(ParentWindow, SearchBox.Text); ParentWindow.frmMain.Content = res; } else if (name == "report") { ReportView report = new ReportView(); report.ShowDialog(); return; } else { return; } #endregion }
public Detail(string ISBN, SearchRes res, Window1 window) { _ISBN = ISBN; Res = res; ParentWindow = window; ChangedTextBox = new HashSet <TextBox>(); TextBoxChangedCounter = 0; InitializeComponent(); Bind(); }