ahigh2

LayerCanvas.ArrangeOverride Setting Invalid FrameworkElement Size (Crashes App)

Discussion created by ahigh2 on Sep 19, 2013
Latest reply on Jan 22, 2014 by sgavathe
Hi,

I'm intermittently experiencing an error when rapidly changing map scales (i.e. from very large to very small, or vice-versa) wherein my application will crash. It appears that the LayerCanvas.ArrangeOverride is, for some reason, attempting to set an invalid Width property on the FrameworkElement's dependency property. Based on this link, it appears that the issue was carried over from the Silverlight API: http://stackoverflow.com/questions/14051823/unhandled-error-in-silverlight-application-code-4004-system-argumentexception. Has anyone else encountered this problem and been able to work around it? The following is a snippet of the stack trace with the offending method:

System.ArgumentException: '-907.750834278924' is not a valid value for property 'Width'.
   at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
   at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
   at System.Windows.FrameworkElement.set_Width(Double value)
   at ESRI.ArcGIS.Client.LayerCanvas.ArrangeOverride(Size finalSize)
   at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
   at System.Windows.UIElement.Arrange(Rect finalRect)
   at System.Windows.ContextLayoutManager.UpdateLayout()
   at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
   at System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()
   at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
   at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
   at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
   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)


Thanks,

Aaron

Outcomes