This is a migrated thread and some comments may be shown as answers.

NullReferenceException resizing a ContainerShape

1 Answer 43 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Manuel
Top achievements
Rank 1
Manuel asked on 03 Sep 2015, 01:30 PM

Hi, I'm trying to use ContainerShapes in my application, but I always get a NullReferenceException when I resize a ContainerShapes.

I've not been able to reproduce the issue in other applications so I'm quite sure it's something on my side, but the stacktrace contains only calls to Telerik code so I'm stuck trying to figure out what's wrong... Can you provide me some hints?

I'm on .NET framework 4.0, Telerik UI for WPF 2015.2.728.40.

Here is the stack trace of the exception:

at Telerik.Windows.Diagrams.Core.ManipulationTool.<>c__DisplayClass15.<>c__DisplayClass17.<CreateAsyncCommand>b__9(Object state)
at Telerik.Windows.Diagrams.Core.UndoableDelegateCommand.Execute(Object state)
at Telerik.Windows.Diagrams.Core.AsyncStateCommand.Execute(Object state)
at Telerik.Windows.Diagrams.Core.AsyncStateCommand.Complete(Boolean commit, Object state)
at Telerik.Windows.Diagrams.Core.CompositeAsyncStateCommand.Complete(Boolean commit, Object state)
at Telerik.Windows.Diagrams.Core.ManipulationTool.MouseUp(PointerArgs e)
at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
at Telerik.Windows.Diagrams.Core.ToolService.MouseUp(PointerArgs e)
at Telerik.Windows.Controls.RadDiagram.OnMouseLeftButtonUp(MouseButtonEventArgs e)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(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 MyApplication.App.Main() in D:\git\dfm-designer\src\MyApplication\obj\x86\Debug\App.g.cs:line 0

 

Many thanks!

1 Answer, 1 is accepted

Sort by
0
Accepted
Kiril Vandov
Telerik team
answered on 08 Sep 2015, 08:46 AM
Hello Manuel,

Based on the provided information and the CallStack I would suggest you to start the investigation from the Content located in the ContainerShape's. Try to comment their content and see if the issue persists, if the exceptions stopped, try to find any controls in the content that might be measured with Infinity (such as StackPanel,ScrollViewer) and comment only them.
Also I have notice that in the CallStack there is a call to UndoableDelegateCommand, do you execute any command when are making the re-sizing ?
If the issue still persist you could check if the issue is not coming from a routing strategy if you have one applied.

I hope this information helps.

Kind regards,
Kiril Vandov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Diagram
Asked by
Manuel
Top achievements
Rank 1
Answers by
Kiril Vandov
Telerik team
Share this question
or