Hi Walter,
I’ve narrow down the problem and found that the root cause is a NullReferenceExcpetion thrown from DraggingTool obfuscated method name #vw with this stack trace I’ve caught by creating custom DiagramPanel and override the DoDragOver method:
at Northwoods.GoXam.Tool.DraggingTool.#vw(IDataObject dataobj, Boolean undoable)
at Northwoods.GoXam.Tool.DraggingTool.DoDragOver(DragEventArgs e)
at Northwoods.GoXam.DiagramPanel.OnDragOver(DragEventArgs e)
at Org.Dna.Aurora.Presentation.Standard.NetworkViews.GoXam.DEBUGDiagramPanel.OnDragOver(DragEventArgs e)
I’ve caught that exception which got the DoDrop method to be called but it’s then cause the following exception:
DispatcherUnhandledExcpetion: System.InvalidCastException: Unable to cast object of type 'Org.Dna.Aurora.UIFramework.Repositories.RepositoryItemView' to type 'Org.Dna.Aurora.Presentation.Standard.NetworkViews.GoXam.VisualNodeViewModel'.
at System.Linq.Enumerable.<CastIterator>d__b1`1.MoveNext()
at System.Collections.Generic.HashSet`1.UnionWith(IEnumerable`1 other)
at System.Collections.Generic.HashSet`1..ctor(IEnumerable`1 collection, IEqualityComparer`1 comparer)
at Northwoods.GoXam.Model.GraphLinksModel`4.DataCollection.set_Nodes(IEnumerable`1 value)
at Northwoods.GoXam.Model.GraphLinksModel`4.DataCollection.#Bo(IEnumerable`1 value)
at Northwoods.GoXam.PartManager.CopyParts(IEnumerable`1 coll, IDiagramModel destmodel)
at Northwoods.GoXam.Tool.DraggingTool.#8v(IEnumerable`1 originals, Boolean undoable)
at Northwoods.GoXam.Tool.DraggingTool.#tw()
at Northwoods.GoXam.DiagramPanel.#nr(MouseEventArgs e, Diagram other, Point modelpt)
at Northwoods.GoXam.DiagramPanel.OnMouseMove(MouseEventArgs e)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
As you can see it fail to cast an instance from type RepositoryItemView to type VisualNodeViewModel.
RepositoryItemView is the type of node I have for the palette model and VisualNodeViewModel is the type of node of the main diagram’s model.
In the previous version when I drag a node from the palette to the main diagram I did not had the ghost node following the mouse, maybe it’s a sign that I did something wrong in the previous version as well but it was more forgiving then the current version.
Is there a requirement that both the palette and the main diagram’s model will be the same?
Thank you,
Ido.