When zooming the map to a different location from code while the map itself is not visible on screen because another tab in a tabcontrol is active, the following error occurs:
System.ArgumentException: Value does not fall within the expected range.
at MS.Internal.XcpImports.MethodEx(IntPtr ptr, String name, CValue[] cvData)
at MS.Internal.XcpImports.MethodPack(IntPtr objectPtr, String methodName, Object[] rawData)
at MS.Internal.XcpImports.UIElement_TransformToVisual(UIElement element, UIElement visual)
at System.Windows.UIElement.TransformToVisual(UIElement visual)
at ESRI.ArcGIS.Client.Map.getFullViewExtent()
at ESRI.ArcGIS.Client.Map.loadContinuousZoomLayersInView(Boolean useTransitions)
at ESRI.ArcGIS.Client.Map.setOriginAndResolution(Double currentResolution, MapPoint currentOrigin, Boolean resetTransforms, Boolean skipLayers)
at ESRI.ArcGIS.Client.Map.beginZoomToExtent(Envelope targetExtent, Boolean skipAnimation)
at ESRI.ArcGIS.Client.Map.zoomTo(Geometry geom, Boolean skipAnimation)
at ESRI.ArcGIS.Client.Map.ZoomTo(Geometry geom)
at EsriTestExtendBug.MainPage.Button_Click(Object sender, RoutedEventArgs e)
at System.Windows.Controls.Primitives.ButtonBase.OnClick()
at System.Windows.Controls.Button.OnClick()
at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
at System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e)
at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName, UInt32 flags)}
The same error occurs when panning the map with the mouse and quickly change tabs before rendering the map is complete.
The error is easily reproducible with the attached project and occurs when clicking the button on the second tab which tries to zoom the map to a geometry. Assigning a new extent to the map produces the same error.
These errors did not occur while using the 3.1 API.