- Welcome, Guest. Please Login or Register
MindFusion  
  We have released initial version of MindFusion.Scheduling library for HTML5 & JavaScript.  
  HomeHelpSearchLoginRegister   
     
     
   
 
Page Index Toggle Pages: 1 Send Topic Print  
Setting color for the anchor points of a link
Read 283 times

ashar11   Offline
Junior Member
**
Posts: 54
Gender: male
I Love MindFusion!


   
     
 
Setting color for the anchor points of a link
Jun 9th, 2018 at 6:47am
 
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
 
 
 
IP Logged    
 
     

Slavcho   Offline
God Member
*****
Posts: 1529
Gender: male
tech.support


   
     
 
Re: Setting color for the anchor points of a link
Reply #1 - Jun 11th, 2018 at 9:34am
 
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
 
 
 
IP Logged    
 
     

ashar11   Offline
Junior Member
**
Posts: 54
Gender: male
I Love MindFusion!


   
     
 
Re: Setting color for the anchor points of a link
Reply #2 - Jun 11th, 2018 at 11:12am
 
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);
                }
            }

 
 
 
IP Logged    
 
     

Slavcho   Offline
God Member
*****
Posts: 1529
Gender: male
tech.support


   
     
 
Re: Setting color for the anchor points of a link
Reply #3 - Jun 12th, 2018 at 8:59am
 
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.
 
 
 
IP Logged    
 
     

ashar11   Offline
Junior Member
**
Posts: 54
Gender: male
I Love MindFusion!


   
     
 
Re: Setting color for the anchor points of a link
Reply #4 - Jun 12th, 2018 at 10:18am
 
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 | 16 )
CaptureLink.PNG
 
IP Logged    
 
     

Slavcho   Offline
God Member
*****
Posts: 1529
Gender: male
tech.support


   
     
 
Re: Setting color for the anchor points of a link
Reply #5 - Jun 13th, 2018 at 8:22am
 
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.
 
 
 
IP Logged    
 
     

ashar11   Offline
Junior Member
**
Posts: 54
Gender: male
I Love MindFusion!


   
     
 
Re: Setting color for the anchor points of a link
Reply #6 - Jun 13th, 2018 at 10:14am
 
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.
 
 
 
IP Logged    
 
     
Page Index Toggle Pages: 1 Send Topic Print