Exemplo n.º 1
0
        public void AddComponent(ComponentBase component)
        {
            component.Initialize();

            component.PropertyChanged += ComponentPropertyChangedHandler;

            _components.Add(component);
            ComponentsCollectionChanged?.Invoke(this, EventArgs.Empty);
        }
Exemplo n.º 2
0
        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);
        }