예제 #1
0
        private void OnAddComponentExecute()
        {
            var newComponent = new ProjectComponentWrapper(new ProjectComponent());

            newComponent.PropertyChanged += ProjectComponentWrapper_PropertyChanged;
            ProjectComponents.Add(newComponent);
            Project.Model.ProjectComponents.Add(newComponent.Model);
            newComponent.ComponentName = ""; // Trigger validation :-)
        }
예제 #2
0
 private void InitializeProjectComponents(ICollection <ProjectComponent> projectComponents)
 {
     foreach (var wrapper in ProjectComponents)
     {
         wrapper.PropertyChanged -= ProjectComponentWrapper_PropertyChanged;
     }
     ProjectComponents.Clear();
     foreach (var projectComponent in projectComponents)
     {
         var wrapper = new ProjectComponentWrapper(projectComponent);
         ProjectComponents.Add(wrapper);
         wrapper.PropertyChanged += ProjectComponentWrapper_PropertyChanged;
     }
 }