private void ctrlBtnEventNew_Click(object sender, RoutedEventArgs e) { ClusterEventWindow Wnd = new ClusterEventWindow(); Wnd.WindowStartupLocation = WindowStartupLocation.CenterOwner; Wnd.Owner = this; Wnd.AvailableCategories = GetAvailableCategories(); Wnd.AvailableTypes = GetAvailableTypes(); Wnd.AvailableNames = GetAvailableNames(); bool?RetVal = Wnd.ShowDialog(); if (RetVal.HasValue && RetVal == true) { Dictionary <string, string> ArgMap = new Dictionary <string, string>(); ClusterEvent NewEvt = new ClusterEvent(Wnd.SelectedCategory, Wnd.SelectedType, Wnd.SelectedName, Wnd.GetArgDictionary()); NewEvt.RebuildJsonStringForGui(); ClusterEvents.Add(NewEvt); RegistrySaver.AddRegistryValue(RegistrySaver.RegCategoryClusterEvents, NewEvt.SerializeToString()); AppLogger.Log("New cluster event stored: " + NewEvt.ToString()); } else { // Nothing to do } }