Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Link being drawn after handling Node ExpandButtonC (Read 2169 times)
ToddGreve
YaBB Newbies
*
Offline



Posts: 4
Location: USA
Joined: Mar 19th, 2010
Link being drawn after handling Node ExpandButtonC
Aug 26th, 2010 at 2:40am
Print Post  
I have an event handler associated with the ExpandButtonClicked event on my diagram. Within this handler if the node is expanded I am posting a call to a web service which returns to me the nodes to display below this one.
When this has finished executing I am now finding the diagram is attempting to draw a link from the node I was expanding and following the cursor around on the canvas.
Any idea either why this is happening, or how I can either prevent this happening, or force the diagram to stop drawing a link if it is being drawn?
The other piece of information to add is that as the retrieve may be delayed in returning, I am configuring a BusyIndicator to show in the ExpandButtonClicked handler. Only when this indicator is shown does the bizarre behaviour appear.
I appreciate any thoughts or suggestions you may have
Thanks
Todd
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link being drawn after handling Node ExpandBut
Reply #1 - Aug 26th, 2010 at 8:10am
Print Post  
BusyIndicator might be stealing the mouse capture which the diagram sets upon mouse-down, and then it misses the mouse-up event and remains in drawing state. Some things you might try are:

- call diagram.CaptureMouse after showing the indicator
- set Behavior = DoNothing and reset it back when the request is handled
- call CancelDrag from LinkCreating if the indicator is currently visible

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



Posts: 4
Location: USA
Joined: Mar 19th, 2010
Re: Link being drawn after handling Node ExpandBut
Reply #2 - Aug 27th, 2010 at 6:08am
Print Post  
Thanks for the suggestions Stoyo. I tried each and unfortunately none worked. I even tried all together. At this point I have disabled the busyIndicator and things appear to be working ok. I will run some more timing tests in the Cloud to make sure things are running quicker than in the local dev environment and perhaps not needing the busy indicator.
Thanks
Todd
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link being drawn after handling Node ExpandBut
Reply #3 - Aug 27th, 2010 at 3:10pm
Print Post  
I've tried that with the code below but couldn't reproduce a link to draw after clicking the expand button. The Diagram and BusyIndicator are placed in the same cell of a Grid panel.

Code
Select All
private void OnExpandButtonClicked(object sender, MindFusion.Diagramming.Silverlight.NodeEventArgs e)
{
	busyIndicator.IsBusy = true;

	var t = new DispatcherTimer();
	t.Interval = TimeSpan.FromSeconds(3);
	t.Tick += new EventHandler(t_Tick);
	t.Start();
}

void t_Tick(object sender, EventArgs e)
{
	busyIndicator.IsBusy = false;
	var t = (DispatcherTimer)sender;
	t.Stop();
} 



Could you email a sample project that shows the problem to support@mindfusion.eu?

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