Jump to content
Software FX Community

Chart Crash - Parent Container with Property Visibility=Collapsed


bigCD
 Share

Recommended Posts

Hi I get the following exception when constructing a chart at runtime and then placing it as a child into a control with it's visibility set to collapsed.

 System.ArgumentException was unhandled

  Message="Height must be non-negative."

  Source="WindowsBase"

  StackTrace:

at System.Windows.Size.set_Height(Double value)

at ChartFX.WPF.Controls.SpacingDockPanel.MeasureOverride(Size availableSize)

at System.Windows.FrameworkElement.MeasureCore(Size availableSize)

at System.Windows.UIElement.Measure(Size availableSize)

at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)

at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)

at System.Windows.Controls.Grid.MeasureOverride(Size constraint)

at System.Windows.FrameworkElement.MeasureCore(Size availableSize)

at System.Windows.UIElement.Measure(Size availableSize)

at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)

at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)

at System.Windows.Controls.Grid.MeasureOverride(Size constraint)

at System.Windows.FrameworkElement.MeasureCore(Size availableSize)

at System.Windows.UIElement.Measure(Size availableSize)

at ChartFX.WPF.Controls.SpacingDockPanel.MeasureOverride(Size availableSize)

at System.Windows.FrameworkElement.MeasureCore(Size availableSize)

at System.Windows.UIElement.Measure(Size availableSize)

at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)

at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)

at System.Windows.Controls.Grid.MeasureOverride(Size constraint)

at System.Windows.FrameworkElement.MeasureCore(Size availableSize)

at System.Windows.UIElement.Measure(Size availableSize)

at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)

at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)

at System.Windows.Controls.Grid.MeasureOverride(Size constraint)

at System.Windows.FrameworkElement.MeasureCore(Size availableSize)

at System.Windows.UIElement.Measure(Size availableSize)

at System.Windows.Controls.Border.MeasureOverride(Size constraint)

at System.Windows.FrameworkElement.MeasureCore(Size availableSize)

at System.Windows.UIElement.Measure(Size availableSize)

at System.Windows.Controls.Border.MeasureOverride(Size constraint)

at System.Windows.FrameworkElement.MeasureCore(Size availableSize)

at System.Windows.UIElement.Measure(Size availableSize)

at System.Windows.Controls.Grid.MeasureOverride(Size constraint)

at System.Windows.FrameworkElement.MeasureCore(Size availableSize)

at System.Windows.UIElement.Measure(Size availableSize)

at System.Windows.Controls.Control.MeasureOverride(Size constraint)

at System.Windows.FrameworkElement.MeasureCore(Size availableSize)

at System.Windows.UIElement.Measure(Size availableSize)

at System.Windows.Controls.Control.MeasureOverride(Size constraint)

at ChartFX.WPF.Chart.MeasureOverride(Size constraint)

at System.Windows.FrameworkElement.MeasureCore(Size availableSize)

at System.Windows.UIElement.Measure(Size availableSize)

at System.Windows.Controls.Grid.MeasureOverride(Size constraint)

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.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, Boolean isSingleParameter)

at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)

at System.Windows.Threading.DispatcherOperation.InvokeImpl()

at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)

at System.Threading.ExecutionContext.runTryCode(Object userData)

at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)

at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)

at System.Threading.ExecutionContext.Run(ExecutionContext 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, Boolean isSingleParameter)

at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)

at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)

at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)

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.Threading.Dispatcher.PushFrame(DispatcherFrame frame)

at System.Windows.Threading.Dispatcher.Run()

at System.Windows.Application.RunInternal(Window window)

at System.Windows.Application.Run(Window window)

at System.Windows.Application.Run()

at myPlanIt.Application.Main() in C:\Users\Administrator\Documents\Visual Studio 2008\Projects\Sara\SaraHost\obj\Debug\Application.g.vb:line 73

  InnerException:

Same code works fine if I ensure the Tab Control (Parent) is Visibility of Visible. More detail available if needed. Any insight welcome.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...