Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic How to change the color of the LinkNode? (Read 3009 times)
padmavathi
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 23
Joined: Jun 29th, 2010
How to change the color of the LinkNode?
Jul 1st, 2010 at 6:37am
Print Post  
I need to change the color of a link node in the diagram when a link is selected? How can I do this in DiagramLite?



Thanks & Regards
Padma
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How to change the color of the LinkNode?
Reply #1 - Jul 1st, 2010 at 8:54am
Print Post  
The easiest way is to set the Stroke property in response to LinkSelected and LinkDeselected events. You might also do that by defining a style with storyboards for the "Selected" and "Unselected" visual states.

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


I love YaBB 1G - SP1!

Posts: 23
Joined: Jun 29th, 2010
Re: How to change the color of the LinkNode?
Reply #2 - Jul 1st, 2010 at 9:42am
Print Post  
When I did this way:
void diagram_LinkSelected(object sender, LinkEventArgs e)
       {
System.Windows.Media.SolidColorBrush brsh = e.Link.Stroke as System.Windows.Media.SolidColorBrush;
           brsh.Color = Colors.Red;
       }

if I select any one link in the diagram, all links' colors are getting changed to Red. Also any new link being drawn will also be in Red color....
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How to change the color of the LinkNode?
Reply #3 - Jul 1st, 2010 at 10:00am
Print Post  
This changes the color of the default brush used by all links. Set link.Stroke to a new SolidColorBrush instance instead.

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


I love YaBB 1G - SP1!

Posts: 23
Joined: Jun 29th, 2010
Re: How to change the color of the LinkNode?
Reply #4 - Jul 1st, 2010 at 11:52am
Print Post  
Yes..I worked out. Its working fine as you said.


Thanks & Regards
Padma
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint