private bool OnDelDocumentCommandCanExecute(IPackageDocumentViewModel document) { if (string.IsNullOrEmpty(CurrentPackagePath)) { return(false); } return(ShellService.CouldDeleteDocument(document)); }
private bool OnSaveDocumentCommandCanExecute(IPackageDocumentViewModel document) { if (string.IsNullOrEmpty(CurrentPackagePath)) { return(false); } if (document != null) { var d = document as ViewModelBase; if (d != null && d.IsDirty) { return(true); } } return(false); }
private async void OnSaveDocumentCommandExecute(IPackageDocumentViewModel document) { var layoutContentViewModel = document as ILayoutContentViewModel; if (layoutContentViewModel != null) { bool result = await layoutContentViewModel.SaveViewModel(); if (!result) { Log.Info("'" + layoutContentViewModel.Title + "'" + "File Save Error!"); return; } Log.Info("'" + layoutContentViewModel.Title + "'" + Properties.Resources.FileSavedMessage); this.ShellService.Messager.Balloon.ShowCustomBalloon(layoutContentViewModel.Title, Properties.Resources.FileSavedMessage, BalloonIcon.Info, PopupAnimation.Fade, 3000); } }
private void OnDelDocumentCommandExecute(IPackageDocumentViewModel document) { ShellService.DeleteDocument(document); }