private void children_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
{
if (e.Action == NotifyCollectionChangedAction.Add)
{
if (!Rectangle2D.IsNullOrEmpty(this.fullBounds))
{
UpdateFullBounds(e.NewItems);
}
}
else
{
if (e.Action == NotifyCollectionChangedAction.Reset)
{
base.Container.Children.Clear();
}
else
{
base.Container.Children.Remove(e.OldItems[0] as UIElement);
}
this.fullBounds = Rectangle2D.Empty;
}
this.Invalidate();
}