Hello everyone,
I have a Pro SDK add-in tool (a dockpane). It has a listbox that I populate with the feature layers from the Contents pane. Currently, it's using a Refresh button that the end-user can manually click to update the listbox if anything changes within the Contents pane. That's working fine. However, I'd like to enhance this a bit to auto-update the listbox based on "live" changes from the Contents pane. Examples could be if someone imports a new feature layer into the map or a feature layer gets renamed while the dockpane is open.
I'm starting to get the hang of Pro SDK and WPF/XAML, but still have a lot to learn. Is it possible to "monitor" the Contents pane and auto-update the listbox? If so, what approach would I use to accomplish that? Thanks for any advice.
Solved! Go to Solution.
Hi,
Look at the LayerSnapModes sample. It uses ActiveMapViewChangedEvent, LayersAddedEvent and LayersRemovedEvent to populate snap list.
Hi,
Look at the LayerSnapModes sample. It uses ActiveMapViewChangedEvent, LayersAddedEvent and LayersRemovedEvent to populate snap list.
Thanks! That got me on the right track and is working for me now. Ended up implementing these subscriptions:
ActiveMapViewChangedEvent.Subscribe(func_OnActiveMapViewChanged); // if active map changes
LayersAddedEvent.Subscribe(func_OnLayersAddRem); // if feature layer added
LayersRemovedEvent.Subscribe(func_OnLayersAddRem); // if feature layer removed
LayersMovedEvent.Subscribe(func_OnLayersAddRem); // if feature layer reordered
MapMemberPropertiesChangedEvent.Subscribe(func_OnMapMembersPropertyChanged); // if feature layer renamed