Intermittent ArgumentOutOfRangeException when using AlternativeFrame

1

I'm using WinRTXamlToolkit's AlternativeFrame in a Xamrin/MVVMCross Windows 8.1 application to support animations while doing page navigations. The animations run fine for the first couple of transitions, but I will intermittently get an Application UnhandledException mid-animation --

The operation attempted to access data outside the valid range (Exception from HRESULT: 0x8000000B)"

System.ArgumentOutOfRangeException: This collection cannot work with indices larger than Int32.MaxValue - 1 (0x7FFFFFFF - 1). Parameter name: index at System.Runtime.InteropServices.WindowsRuntime.ListToBindableVectorAdapter.EnsureIndexInt32(UInt32 index, Int32 listCapacity) at System.Runtime.InteropServices.WindowsRuntime.ListToBindableVectorAdapter.GetAt(UInt32 index)

That's all I get for the stack trace. The same animation that works several times will throw the error on a future attempt. Anyone have any ideas what could be causing this or ideas on how to get more information?

c#
windows-runtime
winrt-xaml
mvvmcross
winrt-xaml-toolkit
asked on Stack Overflow May 15, 2015 by foson • edited Jun 20, 2020 by Community

1 Answer

1

The offending views were unnecessarily UI heavy -- GridViews inside ListViews when simple ItemsControls would have sufficed. I replaced them and the exception went away.

answered on Stack Overflow May 27, 2015 by foson

User contributions licensed under CC BY-SA 3.0