示例#1
0
 private bool OnDelDocumentCommandCanExecute(IPackageDocumentViewModel document)
 {
     if (string.IsNullOrEmpty(CurrentPackagePath))
     {
         return(false);
     }
     return(ShellService.CouldDeleteDocument(document));
 }
示例#2
0
 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);
 }
示例#3
0
        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);
            }
        }
示例#4
0
 private void OnDelDocumentCommandExecute(IPackageDocumentViewModel document)
 {
     ShellService.DeleteDocument(document);
 }