Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic updating existing link thickness? (Read 2288 times)
steve
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 16
Joined: Feb 23rd, 2010
updating existing link thickness?
Feb 7th, 2011 at 3:47pm
Print Post  
Hi Stoyan, apologies if this has already been covered - I have searched the forum and havnt had any luck.

I'm trying to update the thickness of an existing (selected) DiagramLink object programmatically, but I havnt been able to find the correct field to update (setting pen.Brush, pen.DashStyle both work fine for color and line style so I assume thickness should be similar).

The code I've tried (setting all the thickness values I can find) is below - is there another field that I need to set somewhere?

Regards,
Steve



private void SetSelectedLinkWidth(double width)
{
foreach (var item in diag.Selection.Items)
{
if (item is DiagramLink)
{
((DiagramLink) item).StrokeThickness = width;
((DiagramLink) item).Pen.Thickness = width;
((DiagramLink) item).BorderThickness = new Thickness(width);
}
}
}
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: updating existing link thickness?
Reply #1 - Feb 7th, 2011 at 4:36pm
Print Post  
Hi Steve,

The Silverlight Path object that represents the link segments has its StrokeThickness bound to the link's StrokeThickness. However, it seems the Path never repaints itself if only StrokeThickness is changed. It does refresh correctly if its Data property is set, which happens from the UpdateFromPoints method, so you can do this as a workaround:

link.StrokeThickness = width;
link.UpdateFromPoints();

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


I love YaBB 1G - SP1!

Posts: 16
Joined: Feb 23rd, 2010
Re: updating existing link thickness?
Reply #2 - Feb 14th, 2011 at 2:01pm
Print Post  
Hi Stoyan - that did the trick.

Many thanks,
Steve
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint