/// <summary> /// Initializes the current <see cref="ProcessDataTriggerViewModel"/>. /// </summary> /// <param name="model">The model.</param> /// <param name="parent">The parent view model.</param> /// <exception cref="System.ArgumentNullException"> /// model /// or /// parent /// </exception> public void Initialize(ProcessExternalDataEdit model, IProcessExternalDataListViewModel parent) { if (model == null) throw new ArgumentNullException("model"); if (parent == null) throw new ArgumentNullException("parent"); ParentViewModel = parent; Model = model; _externalDataConnectionList = parent.ExternalDataConnectionList; selectedExternalDataConnection = ExternalDataConnectionList.FirstOrDefault(p => p.SystemName == Model.ExternalDataConnectionName); this.RaisePropertyChanged(() => SelectedExternalDataConnection); }
public IExternalDataViewModel CreateViewModel(ProcessExternalDataEdit externalData, IProcessExternalDataListViewModel parentViewModel) { if (externalData == null) throw new ArgumentNullException("external Data"); if (parentViewModel == null) throw new ArgumentNullException("parentViewModel"); var viewModel = ProcessExternalDataViewModelFactory.CreateExport().Value; viewModel.Initialize(externalData, parentViewModel); return viewModel; }