Page Index Toggle Pages: 1 [2]  Send TopicPrint
Hot Topic (More than 10 Replies) Questions about the diagramming package for Xamarin (Read 910 times)
dpru2
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 11
Joined: Feb 2nd, 2021
Re: Questions about the diagramming package for Xamarin
Reply #15 - Feb 12th, 2021 at 1:39pm
Print Post  
Thank you for the quick turnaround on that.

With regard to the links, an interesting behavior I have found is that when the following 2 expressions are in this order, I correctly get a link with 3 segments that is drawn well:

Code (C++)
Select All
link1.SegmentCount = 3;
link1.Shape = LinkShape.Cascading;
 



However, if I just change the order of the statements to this:

Code (C++)
Select All
link1.Shape = LinkShape.Cascading;
link1.SegmentCount = 3;
 



Then I suddenly get the "initially-unattached" problem. It seems as though setting these properties results in some methods being called in the background that are doing some heavy lifting, and the order in which those methods are called apparently matters to how the links are drawn.
  
Back to top
 
IP Logged
 
dpru2
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 11
Joined: Feb 2nd, 2021
Re: Questions about the diagramming package for Xamarin
Reply #16 - Feb 12th, 2021 at 1:44pm
Print Post  
On another note: I've started using the build that you uploaded and linked to in your previous post.

It seems like the "NodeModifying" event is raised when I resize a node, but not when I move a node.

In fact, I have attempted to subscribe to multiple events:

Code
Select All
node1.PropertyChanged += Node1_PropertyChanged;
diagram.NodeModifying += Diagram_NodeModifying;
diagram.NodeModified += Diagram_NodeModified;
diagram.LinkModifying += Diagram_LinkModifying;
diagram.SelectionModifying += Diagram_SelectionModifying;
 



I've put breakpoints at the beginning of each of the event handlers, and it seems as if none of the above events gets raised when a node is moved. Resizing a node will call the NodeModifying event and then when the resize is finished it calls the NodeModified event.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 2450
Joined: Oct 19th, 2005
Re: Questions about the diagramming package for Xamarin
Reply #17 - Feb 12th, 2021 at 2:18pm
Print Post  
Have you enabled the AdjustmentHandles.Move bit in EnabledHandles as shown couple of posts above? PanAndModify incorrectly lets you move without it, but then leads to some confusion with events. We'll fix that for upcoming release and you won't be able to move nodes without it then.

Regards,
Slavcho
  
Back to top
 
IP Logged
 
dpru2
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 11
Joined: Feb 2nd, 2021
Re: Questions about the diagramming package for Xamarin
Reply #18 - Feb 12th, 2021 at 2:41pm
Print Post  
Ah, I apologize. When I enabled the handles like you said, it correctly fired the event handler.

With that now working, it is also correctly "re-routing" the link as I move the nodes.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 2450
Joined: Oct 19th, 2005
Re: Questions about the diagramming package for Xamarin
Reply #19 - Feb 17th, 2021 at 2:38pm
Print Post  
Quote:
However, if I just change the order of the statements to this ...Then I suddenly get the "initially-unattached" problem.


Cascading links with just one segment aren't valid and you'd get one of the end points unaligned, with later SegmentCount setter not realigning it. In this build Shape setter resets SegmentCount internally if it's 1 (as we already do in other platforms) so order shouldn't matter anymore -


https://mindfusion.eu/_temp/XamarinDiagram.zip

It also implements a WhileCreating flag for RoutingOptions.TriggerRerouting. With that and RouteLinks enabled, you shouldn't have to re-route links explicitly from event handlers.

Regards,
Slavcho
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1 [2] 
Send TopicPrint