public void Unregister(IDrawable drawable) { ICollection <object> objects = drawable.GetObjects(); foreach (object obj in objects) { UI.Children.Remove((UIElement)obj); } }
public void Register(IDrawable drawable) { ICollection <object> objects = drawable.GetObjects(); foreach (object obj in objects) { UIElement element = (UIElement)obj; if (!UI.Children.Contains(element)) { UI.Children.Add(element); } } }