Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Explicit position for Text of shape (Read 1925 times)
rajesh_patil74
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 220
Joined: Sep 3rd, 2009
Explicit position for Text of shape
Jun 21st, 2011 at 5:39am
Print Post  

Hi Stoyo

How one can make the text position explicitly for shape nodes. ?

Also, I would like to show the border for the text and support for re-position the text within the shapenode using mouse.

-Rajesh
  
Back to top
WWW  
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Explicit position for Text of shape
Reply #1 - Jun 21st, 2011 at 7:57am
Print Post  
Hi Rajesh,

You can set explicit text position by overriding ShapeNode.UpdateVisuals and setting the TextMargin property to the value you need after calling the base method.

If you set TextMargin directly without overriding UpdateVisuals, the control will change it automatically to match the Shape.TextRectangle value once you move or resize the node, but you might try updating it from a NodeModifying handler.

To show a border, modify the ShapeNode's Xaml template and insert a <Border> element between the Grid and TextBlock elements.

You could show a temporary node when the user enables text-repositioning mode, and synchronize the text position with the node's position while the node is being moved.

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