1) What is the best way to set the Image on a ShapeNode in a NodeListView in xaml? 2) I created a class that inherits from ShapeNode and added it to the NodeListView. The class is barebones with no implementation. The node shows up in the NodeListView just fine. However, when I drag it on the diagram, I get an error (stack trace below). Why would that throw an error and the other ShapeNodes in the NodeListView do not? 3) This question isn't specific to WPFDiagram but how do I protect my WPF app from crashing from an error thrown in MindFusion.Diagramming.Wpf.Diagram.OnDrop(DragEventArgs e)?
<mindfusion:NodeListView Name="nodeListView"> <mindfusion:ShapeNode Shape="Rectangle" Bounds="2,2,25,25" mindfusion:NodeListView.Label="SQL"/> <mindfusion:ShapeNode Shape="Rectangle" Bounds="2,2,25,25" mindfusion:NodeListView.Label="CMD"/> <abc:CustomNode></abc:CustomNode> </mindfusion:NodeListView>
"Object reference not set to an instance of an object."
at MindFusion.Diagramming.Wpf.Diagram.OnDrop(DragEventArgs e) at System.Windows.UIElement.OnDropThunk(Object sender, DragEventArgs e) at System.Windows.DragEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget) 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.RaiseEvent(RoutedEventArgs e) at System.Windows.OleDropTarget.RaiseDragEvent(RoutedEvent dragEvent, Int32 dragDropKeyStates, Int32& effects, DependencyObject target, Point targetPoint) at System.Windows.OleDropTarget.MS.Win32.UnsafeNativeMethods.IOleDropTarget.OleDrop (Object data, Int32 dragDropKeyStates, Int64 point, Int32& effects) at MS.Win32.UnsafeNativeMethods.DoDragDrop(IDataObject dataObject, IOleDropSource dropSource, Int32 allowedEffects, Int32[] finalEffect) at System.Windows.OleServicesContext.OleDoDragDrop(IDataObject dataObject, IOleDropSource dropSource, Int32 allowedEffects, Int32[] finalEffect) at System.Windows.DragDrop.OleDoDragDrop(DependencyObject dragSource, DataObject dataObject, DragDropEffects allowedEffects) at System.Windows.DragDrop.DoDragDrop(DependencyObject dragSource, Object data, DragDropEffects allowedEffects) at MindFusion.Diagramming.Wpf.NodeListView.OnPreviewMouseMove(MouseEventArgs e) ...
|