public MainWindow() { InitializeComponent(); if (!File.Exists(RetroFE.GetAbsolutePath() + "/Core/RetroFE.exe")) { MessageBox.Show("Could not find RetroFE executable. Exiting."); Close(); } else { MessageBox.Show("This tool has not had a lot of testing. " + Environment.NewLine + Environment.NewLine + "Back up your files and use at your own risk before using this tool."); ObservableCollection <string> layouts = new ObservableCollection <string>(); LauncherListVM launcher = this.TryFindResource("LauncherConfig") as LauncherListVM; CollectionListVM collection = this.TryFindResource("CollectionConfig") as CollectionListVM; ControllerVM controller = this.TryFindResource("ControllerConfig") as ControllerVM; MainVM main = this.TryFindResource("MainConfig") as MainVM; Builder b = new Builder(); launcher.LauncherCollection = b.LoadLaunchers(); collection.CollectionList = b.LoadCollections(launcher.LauncherCollection); main.Layouts = b.LoadLayouts(); b.LoadMain(ref main, main.Layouts, collection.CollectionList); b.LoadController(ref controller); } }
private void Save(string tabItem) { if (tabItem == "General") { MainVM main = this.TryFindResource("MainConfig") as MainVM; main.Save(); } else if (tabItem == "Controller") { ControllerVM vm = this.TryFindResource("ControllerConfig") as ControllerVM; vm.Save(); } else if (tabItem == "Launchers") { LauncherListVM vm = this.TryFindResource("LauncherConfig") as LauncherListVM; vm.Save(vm.SelectedLauncher); } else if (tabItem == "Collections") { CollectionListVM vm = this.TryFindResource("CollectionConfig") as CollectionListVM; vm.Save(vm.SelectedCollection); } }