private void LoadAOMDirectory(AOMDirectory dir) { //LoadBar.IsIndeterminate = true; //LoadBar.Visibility = Visibility.Visible; if (dir.Loaded) { TryingLoad.Visibility = Visibility.Visible; NotLoaded.Visibility = Visibility.Collapsed; Overlord.FromAOMDirectory(dir, (log) => { string errors = log.ErrorsAsString, warnings = log.WarningsAsString, infos = log.InfosAsString; if (!string.IsNullOrWhiteSpace(errors) || !string.IsNullOrWhiteSpace(warnings) || !string.IsNullOrWhiteSpace(infos)) { string msg = "Load complete." + (!string.IsNullOrWhiteSpace(errors) ? "\n\nErrors:\n" + errors : "") + (!string.IsNullOrWhiteSpace(warnings) ? "\n\nWarnings:\n" + warnings : "") + (!string.IsNullOrWhiteSpace(infos) ? "\n\nInfo:\n" + infos : ""); SetValue(MessagesProperty, msg); Debug.WriteLine("Loaded AOM data from " + dir); } //LoadBar.IsIndeterminate = false; //LoadBar.Visibility = Visibility.Hidden; LoadError.Visibility = Visibility.Collapsed; WindowContent.Visibility = Visibility.Visible; }); } //((Storyboard)FileSourceGrid.Resources["FileSourceGridFlash"]).Stop(); }
public PrototypesPage() { Resources.Add("Self", this); Resources.Add("OpenCommand", new DelegateCommand((sender) => { var dialog = new System.Windows.Forms.FolderBrowserDialog(); var result = dialog.ShowDialog(); if (result == System.Windows.Forms.DialogResult.OK) { var aomDir = new AOMDirectory(); aomDir.Load(dialog.SelectedPath); Overlord.FromAOMDirectory(aomDir, (log) => { }); } })); Resources.Add("SaveCommand", new DelegateCommand((sender) => { MessageBox.Show("Saving doesnt work yet"); /*var dialog = new SaveFileDialog() { }; * dialog.ShowDialog();*/ })); Resources.Add("CloseCommand", new DelegateCommand((sender) => { })); Resources.Add("PrototypeImageCommand", new DelegateCommand((prototype) => { var unitSettings = new UnitPrototypeSettings() { Prototype = prototype as PrototypeViewModel, }; unitSettings.Show(); })); InitializeComponent(); /*if (string.IsNullOrWhiteSpace(Overlord.Directory)) { * ((Storyboard)FileSourceGrid.Resources["FileSourceGridFlash"]).Begin(); * }*/ }