private void ExecuteSaveAsCommand() { if (this.OptModel.File == null) { return; } BusyIndicatorService.Run(dispatcher => { string fileName = FileDialogService.GetSaveOptFileName(this.OptModel.File.FileName); if (fileName == null) { return; } BusyIndicatorService.Notify(string.Concat("Saving ", System.IO.Path.GetFileName(fileName), "...")); var opt = this.OptModel.File; try { opt.Save(fileName); dispatcher(() => this.OptModel.File = this.OptModel.File); dispatcher(() => this.OptModel.UndoStackPush("save " + System.IO.Path.GetFileNameWithoutExtension(fileName))); if (!this.OptModel.IsPlayable) { Messenger.Instance.Notify(new MainViewSelectorMessage("PlayabilityMessages")); Messenger.Instance.Notify(new MessageBoxMessage(fileName + "\n\n" + "This opt will not be fully playable.", "Check Opt Playability", MessageBoxButton.OK, MessageBoxImage.Warning)); } } catch (Exception ex) { Messenger.Instance.Notify(new MessageBoxMessage(fileName, ex)); } }); }