예제 #1
0
        private void ShowPendingChangedPopup(NoteObject noteObject)
        {
            var confirmationViewModel = new YesNoConfirmationViewModel
            {
                ConfirmationMessage = CommonResourceManager.Instance.GetResourceString("XRay_YesNoConfirmationView_SavePendingChangesText"),
                OnYesAction         = () =>
                {
                    if (selectedNote != null)
                    {
                        selectedNote.Modified = false;
                    }

                    SaveNote();

                    SelectedNote = noteObject;
                },
                OnNoAction = () =>
                {
                    if (selectedNote != null)
                    {
                        noteCopy?.CopyTo(selectedNote);
                        selectedNote.Modified = false;
                    }

                    SelectedNote = noteObject;
                }
            };

            var popupEventArgs = new RaisePopupEventArgs()
            {
                Title   = CommonResourceManager.Instance.GetResourceString("XRay_YesNoConfirmationView_SavePendingChanges"),
                Content = new YesNoConfirmationView(confirmationViewModel)
            };

            eventAggregator.GetEvent <RaisePopupEvent>().Publish(popupEventArgs);
        }