public bool Close()
        {
            if (HasChanges)
            {
                bool?confirmation = dialogService.ConfirmYesNoCancel(
                    string.Format("Save changes to file \"{0}\"?", name));

                if (confirmation == null || (confirmation == true && !SaveFile()))
                {
                    return(false);
                }
            }
            eventAggregator.PublishOnCurrentThread(new DocumentClosedEvent(this));
            return(true);
        }
        public bool Close()
        {
            if (HasChanges)
            {
                bool?confirmation = dialogService.ConfirmYesNoCancel(
                    string.Format("Save changes to file \"{0}\"?", name));

                if (confirmation == null || (confirmation == true && !SaveFile()))
                {
                    return(false);
                }
            }
            MessengerInstance.Send(new DocumentClosedMessage(this));
            return(true);
        }
Ejemplo n.º 3
0
        public bool Close()
        {
            if (HasChanges)
            {
                bool?confirmation = dialogService.ConfirmYesNoCancel(
                    string.Format("Save changes to file \"{0}\"?", name));

                if (confirmation == null || (confirmation == true && !SaveFile()))
                {
                    return(false);
                }
            }
            UnregisterCommands();
            eventAggregator.GetEvent <DocumentClosedEvent>().Publish(this);
            return(true);
        }