コード例 #1
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();
            }
        }
コード例 #2
0
ファイル: SettingsViewModel.cs プロジェクト: syatin003/Wpf
        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();
                }
            }
        }