예제 #1
0
        private void AddEmailHeaderCommandExecuted()
        {
            RaisePropertyChanged("DisableParentWindow");

            var addEmailHeaderWindow = new AddEmailHeaderView(null);
            addEmailHeaderWindow.ShowDialog();

            RaisePropertyChanged("EnableParentWindow");

            if (addEmailHeaderWindow.DialogResult != null && addEmailHeaderWindow.DialogResult == true)
            {
                if (Content is EmailHeadersView)
                {
                    var view = Content as EmailHeadersView;
                    var viewModel = view.DataContext as EmailHeadersViewModel;
                    viewModel.AllEmailHeaders.Add(addEmailHeaderWindow.ViewModel.EmailHeader.EmailHeader);
                    viewModel.RefreshEmailHeaders();
                }
            }
        }
예제 #2
0
        private void EditEmailHeaderCommandExecuted(EmailHeaderModel emailHeader)
        {
            RaisePropertyChanged("DisableParentWindow");

            var view = new AddEmailHeaderView(emailHeader);
            view.ShowDialog();

            RaisePropertyChanged("EnableParentWindow");
            if (view.DialogResult != null && view.DialogResult == true)
            {
                _adminDataUnit.EmailHeadersRepository.Refresh();
            }
        }