private void Button_rnInstance(object sender, RoutedEventArgs e) { StringPrompt stp = new StringPrompt("Rename Instance", "New name:"); stp.ShowDialog(); if (stp.theString != "" && stp.DialogResult == true) { InstanceManager.RenameInstance(((treeView_instances.SelectedItem as TreeViewItem).Tag as Instance), stp.theString); (treeView_instances.SelectedItem as TreeViewItem).Header = stp.theString; } }
private void Button_aInstance(object sender, RoutedEventArgs e) { StringPrompt sp = new StringPrompt("New Instance", "Name:"); if (sp.ShowDialog() == true) { Instance i = new Instance(sp.theString); InstanceManager.instances.Add(i); UpdateInstances(); } }