public static void Show(TestCaseViewModel tc) { EditTestCaseView tce = new EditTestCaseView(tc); ContentWindow window = ContentWindow.Create(tce, 700, 500); window.Title = "Edit Test Case"; tce.CancelButton.Click += delegate { window.Close(); }; tce.OKButton.Click += delegate { tce.OKButton_Click(); window.Close(); }; window.ShowDialog(); }
private void EditTestCaseButton_Click(object sender, RoutedEventArgs e) { Button b = sender as Button; if (b == null) { return; } TestCaseViewModel tc = b.Tag as TestCaseViewModel; if (tc == null) { return; } EditTestCaseView.Show(tc); }