We are experiencing a problem with the ArcGIS Runtime (desktop) MapView WPF control. Unfortunately our code is extremely large and we are unable to post it here.
Basically, the problem is as follows: we have a WinForm that has a WPF User Control containing a MapView. This form is opened and closed repeatedly throughout the program life cycle. After opening & closing the form several times, the Graphics from all GraphicsLayers disappear. Logically, they are still there, with valid information (visibility, renderers, symbols, spatial references, correct geometries).
Also, after the graphics disappear, the program crashes upon calling HitTestAsync on map control. It's a NUllReferenceException, and here is its Stack Trace:
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at GISRuntime.Map.Components.MapManager.d__b.MoveNext() in...
* Typically, it takes around 4-5 times of closing/reopening for the graphics to disappear. However this number may vary from 2 to 20+.
* We have not seen any difference, property-wise, in the Map View control once the graphics disappear.
* We have another (overview) Map View control whose Graphics continue to be shown after the main map's graphics disappear. We have compared their properties and they are identical.
Which RenderingMode are you using for your graphics layer? for large graphics number it is recommended to use Static mode. If you using static mode and still see the problem, can you create a simple app reproducing the problem and send it to us so we can have close look.
We're using Static mode for all our Graphic layers.
Unfortunately, we cannot create a simple app reproducing the problem, since the business logic and the data flows are quite complex.
Can you still estimate what could be the problem?
For instance, what could be the reason for HItTestAsync crash?
With how you described the problem, it could be many things that cause the issue which make it really hard to tell. And for the graphics disappear and the HitTest crash it seems like an API issue.
I will try to create a similar app to reproduce the problem.
Also in the coming release (so soon) we have done a lot of performance enhancement and bug fixes related to map rendering and HitTest, so once it is available, please update us if you still seeing the same issue with the new version.