Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Dynamic Sizing / NaN (Read 2615 times)
Paul Eden
Full Member
***
Offline



Posts: 128
Joined: Aug 15th, 2007
Dynamic Sizing / NaN
May 19th, 2008 at 1:54pm
Print Post  
Hi

I'm trying to add a Label with it's width set to Double.Nan (it needs to autosize to contect set at runtime) to a diagram. 
As when adding standard WPF controls to the diagram canvas you need to use Diagram.SetItemBounds to make the control big enough to see, is it possible to use the label object to supply sizing data to the DiagramNode?  I tried setting the bound width to label.Width, Label.ActualWidth as well as Double.Nan but all variations result in a 0-width node.


Many thanks


Paul
  
Back to top
WWW  
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Dynamic Sizing / NaN
Reply #1 - May 19th, 2008 at 4:18pm
Print Post  
Hi,

Call Label.Measure() and then set Label.DesiredSize as the node's size.

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