void new_var_Click(object sender, RoutedEventArgs e) { NewKeyWindow nkw = new NewKeyWindow(); if (nkw.ShowDialog() ?? false) { string name = nkw.FinalName.Trim(); if (!string.IsNullOrEmpty(name)) { if (Model.Instance.ActiveMap.Values.ContainsKey(name)) { System.Windows.MessageBox.Show("The map already contains a definition for " + name); } else { Model.Instance.ActiveMap.Values.Add(name, ""); this.RefreshListing(); } } } }