I have an application that will parse a kml stream and display it to the user. This kml stream is processed on a separate thread and updated via a timer. I've provided the user with the ability to click on the map and get a popup for the features beneath. I am using locks in the appropriate locations and I have verified my code is thread safe to the best of my ability. The code works as expected when my base map is unprojected. However, when I switch to a projected basemap (ie Google Maps), I will get a featuresource not open exception when the user clicks on the map to get a popup when a kml refresh is occuring. The main problem with this exception is it is unhandled by code and will crash my application.
Is there a way to override the layer class to catch this exception so it does not crash my application?
Below is the exception:
The FeatureSource is not open. Please call the Open method before calling this method. Type = System.InvalidOperationException Source = WpfDesktopEdition at ThinkGeo.MapSuite.WpfDesktopEdition.Tile.<>c__DisplayClass2.<DrawException>b__0() at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler) ******************* *******************