Skip to main content
1 of 2
Kirk Kuykendall
  • 25.8k
  • 8
  • 67
  • 155

I would try this using these event interfaces: IDocumentEvents, IActiveViewEvents and ILayerEvents.

When IDocumentEvents.ActiveViewChanged fires, refresh your UI with a list of layers, and (re)subscribe, if necessary, to IActiveViewEvents on the current map.

When IActiveViewEvents fires ItemAdded, ItemDeleted, update your UI accordingly, and set/unset listeners to ILayerEvents.

When ItemReordered fires, update your UI, but you shouldn't need to change any ILayerEvents subscriptions.

When ILayerEvents.VisibilityChanged fires, update the checkbox in your UI for the layer.

Kirk Kuykendall
  • 25.8k
  • 8
  • 67
  • 155