I'm creating a Xamarin Forms application that is supposed to work in Android, iOS and Windows UWP. The contents of main page of the application consists of several slides placed inside a Telerik UI RadSlideView
, the contents of those slides is defined for each user and is obtained from an API. One of the possible components of those slides is a map that I am showing using a Xamarin.Forms.Maps.Map
.
It's all working well in Android and iOS but it has a strange behaviour in Windows UWP: if the map is not on the first slide (the one shown when the app starts) then it works ok, but if the map is on the first slide then it throws a NullReferenceException
inside a private method of the MapRenderer
class.
Most of the times I just get a window stating there was an exception, without any further details:
Sometimes the exception is caught by the debugger and I can get its details:
Source: Xamarin.Forms.Maps.UWP
> StackTrace:
at Xamarin.Forms.Maps.UWP.MapRenderer.<MoveToRegion>d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Xamarin.Forms.Maps.UWP.MapRenderer.<>c__DisplayClass0_0.<<OnElementChanged>b__1>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c.<ThrowAsync>b__6_0(Object state)
at System.Threading.WinRTSynchronizationContextBase.Invoker.InvokeCore()
I don't know what I can try to get it working correctly. Any suggestions?