If I add a shapefile to my map and then a dynamic custom layer inherited from a BaseDynamicLayer, then the shapefile is lower on the viewing stack then my custom layer, and it displays correctly.
mapControl.AddShapeFile(directoryPath, shapeFile);
mapControl.AddLayer(dynamicCustomLayer); //this is ok
But if I add my dynamicCustomLayer first, and then add a Shapefile, the shapefile is makes the dynamic layer non viewable because it is higher on the viewing stack...
mapControl.AddLayer(dynamicCustomLayer);
mapControl.AddShapeFile(directoryPath, shapeFile);//now my dynamic layer is invisible
How can I ensure that the dynamic custom layer is always on top of the viewing stack even if my user adds a shapefile after the custom layer was enabled...
I'm using C# ArcEngine 10