LayerCanvas.ArrangeOverride Setting Invalid FrameworkElement Size (Crashes App)

373
1
09-19-2013 12:45 PM
Labels (1)
AaronHigh
New Contributor III
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-sys.... 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
0 Kudos
1 Reply
shaileshgavathe
Occasional Contributor II
Hello Aaron,

Did you find the fix for it?

I am seeing the similar behavior.


Thanks and Regards,
Shay ~


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-sys.... 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
0 Kudos