private void OpenDirectEditGameXmlViewButton_Click(object sender, RoutedEventArgs e)
        {
            string selectedObject = CurrentGameFilesCenterViewComboBox.Text;

            if (String.IsNullOrEmpty(selectedObject))
            {
                return;
            }
            //Try to grab the default wrapper
            XmlObjectsListWrapper selectedWrapper = MainWindowFileController.LoadedListWrappers.GetValueOrDefault(selectedObject);

            //If it is still null there is an issue with the file and the file has not been loaded.
            if (selectedWrapper == null)
            {
                selectedWrapper = MainWindowFileController.LoadedListWrappers.GetValueOrDefault(Properties.Settings.Default.ModTagSetting + "_" + selectedObject);
                if (selectedWrapper == null)
                {
                    MessageBox.Show(
                        "The was an error opening the selected file.\n\n" +
                        "There are a couple of possible issues:\n" +
                        "One issue can be invalid xml for the file you are trying to open. You can validate the xml using the \"File Menu Option and fix any errors in an external editor. " +
                        "Note, after fixing any errors in the xml be sure to run the xml validation in the file menu to refresh the loaded objects.\n\n" +
                        "Another way to fix this issue is load the game xml file for the file you are trying to load. " +
                        "For example, if you are trying to open the recipes xml file for a mod, load the game recipes xml file and this will work, even with invalid xml.",
                        "File Loading Error!",
                        MessageBoxButton.OK,
                        MessageBoxImage.Error);
                    return;
                }
            }
            DirectEditView directEdit = new DirectEditView(selectedWrapper, true, fileLocationPath: XmlFileManager.LoadedFilesPath);

            directEdit.Closed += DirectEdit_Closed;
            directEdit.Show();
        }
        private void OpenDirectEditModXmlViewButton_Click(object sender, RoutedEventArgs e)
        {
            string selectedObject = CurrentModFilesCenterViewComboBox.Text;

            if (String.IsNullOrEmpty(selectedObject))
            {
                return;
            }
            string defaultWrapperKey = selectedObject.Replace(Properties.Settings.Default.ModTagSetting + "_", "");
            //Try to grab the default wrapper
            XmlObjectsListWrapper selectedWrapper = MainWindowFileController.LoadedListWrappers.GetValueOrDefault(defaultWrapperKey);

            if (selectedWrapper == null)
            {
                //Try to load the wrapper from the selected object.
                selectedWrapper = MainWindowFileController.LoadedListWrappers.GetValueOrDefault(selectedObject);
                //If it is still null there is an xml issue
                if (selectedWrapper == null)
                {
                    MessageBox.Show(
                        "The was an error opening the selected file.\n\n" +
                        "There are a couple of possible issues:\n" +
                        "One issue can be invalid xml for the file you are trying to open. You can validate the xml using the \"File Menu Option and fix any errors in an external editor. " +
                        "Note, after fixing any errors in the xml be sure to run the xml validation in the file menu to refresh the loaded objects.\n\n" +
                        "Another way to fix this issue is load the game xml file for the file you are trying to load. " +
                        "For example, if you are trying to open the recipes xml file for a mod, load the game recipes xml file and this will work, even with invalid xml.",
                        "File Loading Error!",
                        MessageBoxButton.OK,
                        MessageBoxImage.Error);
                    return;
                }
                else
                {
                    MessageBox.Show("Missing game file " + defaultWrapperKey + ".xml. In order to use all direct edit functions, you must load this file and reopen the file in a new direct edit window.",
                                    "Missing Game File", MessageBoxButton.OK, MessageBoxImage.Warning);
                }
            }
            DirectEditView directEdit = new DirectEditView(selectedWrapper, false, fileLocationPath: XmlFileManager.ModConfigOutputPath);

            directEdit.Closed += DirectEdit_Closed;
            directEdit.Show();
        }