public void Remove(ISkinnableDrawable component) { if (content == null) { throw new NotSupportedException("Attempting to remove a new component from a target container which is not supported by the current skin."); } if (!(component is Drawable drawable)) { throw new ArgumentException($"Provided argument must be of type {nameof(Drawable)}.", nameof(component)); } content.Remove(drawable); components.Remove(component); }
private void placeComponent(ISkinnableDrawable component, bool applyDefaults = true) { var targetContainer = getFirstTarget(); if (targetContainer == null) { return; } var drawableComponent = (Drawable)component; if (applyDefaults) { // give newly added components a sane starting location. drawableComponent.Origin = Anchor.TopCentre; drawableComponent.Anchor = Anchor.TopCentre; drawableComponent.Y = targetContainer.DrawSize.Y / 2; } targetContainer.Add(component); SelectedComponents.Clear(); SelectedComponents.Add(component); }