Guys, why does the following code throw a NullReferencetException and is there a condition I can check on the overlay before calling its Refresh() method to ensure I do not get this? Assume I do not have access to the map object where Overlay.Refresh() is being called, so I cannot tell if this overlay has already been added to the map or not. Thanks.
wpfMap1.Overlays.Add(overlay);
overlay.Refresh(); // NullReferenceException thrown here
wpfMap1.Refresh(overlay);
TIA.