Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic ShapeControlPoints are not displayed when they are added to an already displayed ShapeNode (Read 2382 times)
Cyrinael
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 42
Joined: Jul 22nd, 2016
ShapeControlPoints are not displayed when they are added to an already displayed ShapeNode
Aug 10th, 2016 at 12:55pm
Print Post  
Hi,

I want to add ShapeControlPoints to a ShapeNode that is already displayed, but they only appear after the Node is stretched or completely new added to the diagram. I already tried to Repaint (shapeNode.Repaint(true)) and Invalidate the Node, but that didn't help either.

Is there another function that forces the Diagram to display the ShapeControlPoints when they are added?

Best regards,

Cyrinael
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: ShapeControlPoints are not displayed when they are added to an already displayed ShapeNode
Reply #1 - Aug 10th, 2016 at 6:13pm
Print Post  
Hi,

Assigning the shape back to the node seems to work -

Code
Select All
private void OnNodeClicked(object sender, NodeEventArgs e)
{
	var node = e.Node as ShapeNode;
	if (node != null)
	{
		var shape = node.Shape;
		shape.ControlPoints.Add(
			new ShapeControlPoint("p5",
				50, 0, 100, UnitType.Percentage,
				20, 0, 100, UnitType.Percentage) { MaxXRelativeToWidth = true });
		node.Shape = shape;
	}
} 



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


I Love MindFusion!

Posts: 42
Joined: Jul 22nd, 2016
Re: ShapeControlPoints are not displayed when they are added to an already displayed ShapeNode
Reply #2 - Aug 11th, 2016 at 5:05am
Print Post  
Hi Slavcho,

that works well. Thank you!

Best regards,

Cyrinael
  
Back to top
 
IP Logged
 
Cyrinael
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 42
Joined: Jul 22nd, 2016
Re: ShapeControlPoints are not displayed when they are added to an already displayed ShapeNode
Reply #3 - Aug 12th, 2016 at 7:39am
Print Post  
Hi Slavcho,

The control points are now correctly added, but now I have the problem, that with the re-assignment all changes I have done to any other ShapeControlPoint are reverted.

Best regards,

Cyrinael
  

Original_001.PNG ( 2 KB | 73 Downloads )
Original_001.PNG
AfterLoading_001.PNG ( 2 KB | 80 Downloads )
AfterLoading_001.PNG
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: ShapeControlPoints are not displayed when they are added to an already displayed ShapeNode
Reply #4 - Aug 12th, 2016 at 8:58am
Print Post  
Hi,

Build from last post (https://mindfusion.eu/_beta/wpfdiag341.zip) also adds a ShapeNode.UpdateShapeControlPoints() method, call it instead of reassigning the Shape property.

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


I Love MindFusion!

Posts: 42
Joined: Jul 22nd, 2016
Re: ShapeControlPoints are not displayed when they are added to an already displayed ShapeNode
Reply #5 - Aug 12th, 2016 at 9:47am
Print Post  
Hi Slavcho,

you are correct. Thank you!

Best regards,

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