private void Clone_Clicked(object source, RoutedEventArgs e) { Button btn = (Button)source; if (btn != null) { ITestCase testCase = btn.DataContext as ITestCase; if (testCase != null) { ITestCase clone_case = testCase.Clone() as ITestCase; if (clone_case != null) { TestCases.Add(clone_case); Document.AddTestCase(clone_case); Document.TestSuiteSaver.SaveSuite(); } } } }