Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic AdjustmentHandle visibility error (Read 3796 times)
binuvc
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 46
Joined: Nov 7th, 2011
AdjustmentHandle visibility error
Dec 9th, 2011 at 12:55pm
Print Post  
Hi,

We have a scenario where we have to reload the shape nodes from our collection on some event.

so we are calling

diagram.ClearAll();
diagram.UpdateLayout();

before reloading the nodes.

But for some node if the adjustmentHandels were visible, they are not removed from the screen and we are able to see invalid squares (which were previously adjustment handles) after reloading.

it throws error on clicking these squares.

Message: Unhandled Error in Silverlight Application
Code: 4004
Category: ManagedRuntimeError
Message: System.NullReferenceException: Object reference not set to an instance of an object.
at MindFusion.Diagramming.Silverlight.InteractionState.Start()
at MindFusion.Diagramming.Silverlight.BehaviorBase.OnMouseMove(MouseEventArgs e)
at MindFusion.Diagramming.Silverlight.Diagram.x2c5d1da1234c3a6a(Object xe0292b9ed559da7d, MouseEventArgs xfbf34718e704c6bc)
at MS.Internal.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName)

Please advice.

Thanks in advance
binuvc
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: AdjustmentHandle visibility error
Reply #1 - Dec 9th, 2011 at 5:28pm
Print Post  
Are you trying the clear the whole diagram from some validation event handler? I don't think that's a good idea, but check if it works if you also call CancelDrag() and Selection.Clear() before ClearAll().

Stoyan
  
Back to top
 
IP Logged
 
binuvc
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 46
Joined: Nov 7th, 2011
Re: AdjustmentHandle visibility error
Reply #2 - Dec 12th, 2011 at 12:42pm
Print Post  
Hi,

We tried the same and it is still not working.

The problem is that our design has a controller class which solely has the right to modify the object model representing the diagram. so when ever a modification is required we inform the same to the controller and which inturn modifies the object model and we just reloads the diagram based on the modified object model.

The following is what we are doing on clear all:

UnHookEvents(); // unhooks all the events attached on the diagram control
diagramLite.CancelDrag();
diagramLite.Selection.Clear();
diagramLite.ClearAll();
diagramLite.UpdateLayout();
HookEvents();

Thanks
binuvc
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: AdjustmentHandle visibility error
Reply #3 - Dec 12th, 2011 at 4:01pm
Print Post  
Ok, but are you doing that from some validation event such as NodeModifying or NodeCreating? These are called after each mouse movement, there's a lot of contextual information kept during interaction made invalid by ClearAll, and so they are not a good place to reload the diagram. You could probably use the after-the-fact events for this update, e.g. NodeCreated or NodeModified.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
binuvc
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 46
Joined: Nov 7th, 2011
Re: AdjustmentHandle visibility error
Reply #4 - Feb 3rd, 2012 at 11:55am
Print Post  
Hi,

We moved the code to link_Created event and still the issue is persisting.

  private void diagram_LinkCreated(object sender, LinkEventArgs e)
        {
            if (e.Link.Origin != e.Link.Destination)
            {

                 this.Dispatcher.BeginInvoke(LoadView);
            }
         }


Please advice.


Thanks
BinuVC
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: AdjustmentHandle visibility error
Reply #5 - Feb 6th, 2012 at 8:19am
Print Post  
Sorry but I could not reproduce this. Please attach a sample project that shows the problem.

Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint