Hi,
I have created a group layer containing multiple layers inside it in the memory database. But what I need is to delete group layer as well as sub layers inside it when application is closed. Because if these layers are not deleted and since memory database will be deleted on close after opening the project again these layers are shown in red exclamation mark.
I thought of deleting the layers in the UninitializeAsync method of the dockpane by fetching the group layer from the active map.
var groupLayers = MapView.Active?.Map?.Layers?.OfType<GroupLayer>();
But it looks like Active map becomes null when it reaches to the UninitializeAsync of the dock pane.
Using other approach I implemented this when the project is opened again using MapViewInitializedEvent or DrawCompleteEvent and not on close.
Not sure if any other better way like deleting on close only which I cant achieve right now.
@Wolf But I dont want to create that table just when the project is opened. I am creating the table only when my functionality is being used.