Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Applying Border for selected Node (Read 3606 times)
Naganathan
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 22
Joined: Jun 14th, 2010
Applying Border for selected Node
Oct 22nd, 2010 at 5:47am
Print Post  
Hi ,
We have a requirement that user can apply border (with diff color) for some specific nodes and save the data..I tried setting Node.Pen property.It works perfectly in case of ShapeNode.but we too have some control nodes with image as content.If i change the Pen value its not displaying the border.I tried using BorderBrush and BorderThickness also but both didnot help me out...
Appreciate your help.
Thanks,
Naganathan NS
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Applying Border for selected Node
Reply #1 - Oct 22nd, 2010 at 7:42am
Print Post  
Hi,

ControlNodes do not display anything else but the hosted controls. If you need a border, you could either add it to your custom controls, or define a control template for ControlNodes that includes a border element:

<Border BorderBrush={TemplateBinding Stroke}>
    <ContentPresenter />
    ....
</Border>

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


I love YaBB 1G - SP1!

Posts: 22
Joined: Jun 14th, 2010
Re: Applying Border for selected Node
Reply #2 - Oct 22nd, 2010 at 10:38am
Print Post  
Hi Stoyo,

Thanks for the quick reply.
I tried setting content template and Tempate for Diagram.But didnot succeed..I tried setting border for the hosted control also but somehow it truncates the control's boundaries..Can u plz provide any sample if you have...Appreciate your help.
I'm using custom control node only.

Thanks,
Naganathan NS
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Applying Border for selected Node
Reply #3 - Oct 22nd, 2010 at 2:26pm
Print Post  
Hi,

You will need a Style that contains a ControlTemplate, and the target type for both should be ControlNode. The ControlTemplate contains border and content presenter as above. This help topic shows how to define such custom style and template for ShapeNodes:
http://www.mindfusion.eu/onlinehelp/diagramlite/index.htm?Styles_and_Control_Tem...

If you have troubles converting that to ControlNodes, we could create an example next week.

Stoyan
  
Back to top
 
IP Logged
 
Naganathan
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 22
Joined: Jun 14th, 2010
Re: Applying Border for selected Node
Reply #4 - Oct 28th, 2010 at 9:26am
Print Post  
Hi,
Thanks for the reply.
I am using custom control hosted on Control Node.I added a border for the control hosted in control node,Regardless of the control shape(its actually an image) the border is coming as rectangle/square only.
Can we add border on top of the node path?For example if the control node hosts a circular image,if we add border then the border should be circular.

Thanks,
Naganathan NS
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Applying Border for selected Node
Reply #5 - Oct 29th, 2010 at 8:29am
Print Post  
Hi,

The Border element auto-sizes to its content by default and will not fill the user control. You might try setting its HorizontalAlignment and VerticalAlignment to Stretch to enable that.

Borders are always rectangular, except that you can their CornerRadius property to make the corners rounded. If you need arbitrary shapes as borders, perhaps you should derive your controls from ShapeNode and set a template that displays ShapeGeometry over the image.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint