/// <summary> /// When creating a test we need a name for the test. After getting the name from GetInput window, /// we show the TestDetails window with a blank TestDetails model, which will save the test if they /// so choose. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param> private void btnAddTest_Click(object sender, RoutedEventArgs e) { var inputDialog = new GetInput("Test Name"); inputDialog.ShowDialog(); var input = inputDialog.Input; //:todo - add validation input was received var tdm = new TestDetailsModel(input, "", "", new List<string>()); var t = new TestDetails(tdm, (RepositoryInfo)cbProjects.SelectedItem); t.ShowDialog(); LoadTests(); }
/// <summary> /// When the user double clicks a test within the datagrid it's fairly obvious they want to edit it. /// Bring up the edit test page, once completed reload tests for any changes. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="MouseButtonEventArgs"/> instance containing the event data.</param> private void dgTests_MouseDoubleClick(object sender, MouseButtonEventArgs e) { if (dgTests.SelectedItem == null) return; //: Misclick? var t = new TestDetails((TestDetailsModel)dgTests.SelectedItem, (RepositoryInfo)cbProjects.SelectedItem); t.ShowDialog(); LoadTests(); }