private void OnSelection(FileSaveData fileSaveData) { // Hide dialog _mainViewModel.DialogContent = null; _mainViewModel.MenuFileSave2(fileSaveData); }
internal void MenuFileSave2(FileSaveData fileSaveData) { IFileViewModel fileViewModel = fileSaveData.FileViewModel; var moduleFileSave = fileSaveData.ModuleFileSave; if (fileViewModel.Filename == null || !System.IO.Path.IsPathRooted(fileViewModel.Filename)) { MenuFileSaveAs(); } else { moduleFileSave.FileSave(fileViewModel); } }
public FileSaveDialogViewModel(MainViewModel mainViewModel) : base("Save") { _mainViewModel = mainViewModel; IconSource = CreateImageSource(@"/ProtonType.Editor;component/icons/SaveDocument.png"); IconSource.Freeze(); // create list of file extensions var fileDocumentsMgr = mainViewModel.Model.FileDocumentsMgr; foreach (var fileSaveModule in fileDocumentsMgr.FileSaveModules) { foreach (var fileViewModel in fileSaveModule.FileViewModels) { var fileSaveList = new FileSaveData(fileSaveModule, fileViewModel); _fileSaveList.Add(fileSaveList); } } }