private void Layers_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
{
DetachLayerEventHandlers(this.editor.GraphicsLayers);
if (e.OldItems != null)
foreach (object layer in e.OldItems)
{
if (layer is GraphicsLayer)
DetachLayerEventHandlers(layer as GraphicsLayer);
}
AttachLayerEventHandlers(this.editor.GraphicsLayers);
UpdateVisibleButtons();
}