public void AddComponent(ComponentBase component) { component.Initialize(); component.PropertyChanged += ComponentPropertyChangedHandler; _components.Add(component); ComponentsCollectionChanged?.Invoke(this, EventArgs.Empty); }
public void RemoveComponent <T>() where T : ComponentBase { var component = GetComponent <T>(); if (component == null) { return; } component.PropertyChanged -= ComponentPropertyChangedHandler; _components.Remove(component); ComponentsCollectionChanged?.Invoke(this, EventArgs.Empty); }