private void chartCmd_Click(object sender, RoutedEventArgs e) { string formName = "Chart " + counter++; ChartWindow frm = new ChartWindow(formName); frm.Show(); }