Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic System.ArgumentException with Message=Width and Height must be non-negative (Read 1424 times)
beetee
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 23
Location: Switzerland
Joined: Jul 13th, 2017
System.ArgumentException with Message=Width and Height must be non-negative
Aug 14th, 2019 at 11:24am
Print Post  
Hello,

We get an exception with following details while opening a diagram. This is happening while opening a diagram with many nested diagrams inside. Version of Mindfusion dlls is 3.5.4.451.It is difficult to create a sample application. Similar issue is reported here and resolved as [url=[url]https://mindfusion.eu/Forum/YaBB.pl?num=1268662655/2][url]https://mindfusion.eu/...[/url][/url].

System.ArgumentException
HResult=0x80070057
Message=Width and Height must be non-negative.
Source=WindowsBase
StackTrace:
at System.Windows.Rect..ctor(Double x, Double y, Double width, Double height)
at A.KY.K(DiagramLink P, Boolean K)
at MindFusion.Diagramming.Wpf.DiagramLink.GetBounds()
at MindFusion.Diagramming.Wpf.DiagramLink.MeasureOverride(Size availableSize)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at A.LN.MeasureOverride(Size availableSize)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.ContextLayoutManager.UpdateLayout()
at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
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 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionCont
ext executionContext, ContextCallback callback, Object state)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at App.Main()


Regards,
beetee
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: System.ArgumentException with Message=Width and Height must be non-negative
Reply #1 - Aug 14th, 2019 at 11:56am
Print Post  
Hi,

Check if you haven't somehow created a link without points or with a negative StrokeThickness value. If by opening you mean loading a diagram's XML file, please attach the file here. If you are building it dynamically, attach a file saved before arranging and please post your layout code.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
beetee
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 23
Location: Switzerland
Joined: Jul 13th, 2017
Re: System.ArgumentException with Message=Width and Height must be non-negative
Reply #2 - Aug 21st, 2019 at 2:25pm
Print Post  
Hello Slavcho,

It was due to link without points.
Thank you for guiding in the right direction.

Regards,
BT
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint