Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Setting color for the anchor points of a link (Read 2749 times)
ashar11
Junior Member
**
Offline


I Love MindFusion!

Posts: 56
Joined: Jun 29th, 2017
Setting color for the anchor points of a link
Jun 9th, 2018 at 5:47am
Print Post  
Hi,
    I have two existing nodes connected by a link, how can i change the color of anchor points of that link on both origin and destination.
Thanks
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3152
Joined: Oct 19th, 2005
Re: Setting color for the anchor points of a link
Reply #1 - Jun 11th, 2018 at 8:34am
Print Post  
Hi,

There's AnchorPoint.Brush property, but make sure you are not using a shared AnchorPattern instance if you need to change colors dynamically.

Regards,
Slavcho
  
Back to top
 
IP Logged
 
ashar11
Junior Member
**
Offline


I Love MindFusion!

Posts: 56
Joined: Jun 29th, 2017
Re: Setting color for the anchor points of a link
Reply #2 - Jun 11th, 2018 at 10:12am
Print Post  
AnchorPoint.Brush didn't worked out for me. Is it possible to set the link brush for existing links like given in the code below. If i apply link brush in LinkCreated function it show me the brush , but not for existing links.

   int countLinkColour = fc.diagram.Links.Count;
            for (int jj = 0; jj <= countLinkColour-1; jj++)
            {
                if (fc.diagram.Links[jj].ToolTip != null)
                {
                   fc.diagram.Links[jj].Brush = new SolidColorBrush(Colors.Yellow);
                }
            }

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


tech.support

Posts: 3152
Joined: Oct 19th, 2005
Re: Setting color for the anchor points of a link
Reply #3 - Jun 12th, 2018 at 7:59am
Print Post  
It should be possible for existing links too. Trace that code with debugger to see if it ever gets to the fc.diagram.Links[jj].Brush = ... assignment.
  
Back to top
 
IP Logged
 
ashar11
Junior Member
**
Offline


I Love MindFusion!

Posts: 56
Joined: Jun 29th, 2017
Re: Setting color for the anchor points of a link
Reply #4 - Jun 12th, 2018 at 9:18am
Print Post  
Yes when debugging its going there , and even stroke is working too but not the brush. I also cannot see the brush(the square shape existing at the end of wire) it only gets visible when i create the link first time, after reopening the application there is just a wire. The picture is attached below in which brush from first link got disappeared after reopening the application

fc.diagram.Links[jj].Brush = new SolidColorBrush(Colors.Yellow); (Not working )

fc.diagram.Links[jj].Stroke = new SolidColorBrush(Colors.DarkBlue); (Working, it changes the color of existing link)
  

CaptureLink.PNG ( 1 KB | 95 Downloads )
CaptureLink.PNG
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3152
Joined: Oct 19th, 2005
Re: Setting color for the anchor points of a link
Reply #5 - Jun 13th, 2018 at 7:22am
Print Post  
Is that square shape a Shape instance you assign to HeadShape and BaseShape properties? If it's a custom shape with your own ID, make sure you register it from application's startup code before loading any files.
  
Back to top
 
IP Logged
 
ashar11
Junior Member
**
Offline


I Love MindFusion!

Posts: 56
Joined: Jun 29th, 2017
Re: Setting color for the anchor points of a link
Reply #6 - Jun 13th, 2018 at 9:14am
Print Post  
Thanks now its working, yes that was a shape instance present in linkcreating which i forgot and i was assuming that it got visible from the linkcreated event after applying brush to yellow.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint