Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic How to make the Diagram bigger automatically? (Read 4275 times)
chris
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 57
Joined: Feb 1st, 2008
How to make the Diagram bigger automatically?
Feb 1st, 2008 at 11:00pm
Print Post  
Hi,

I need the Diagram control enlarge automatically when the Diagram can not hold all the nodes.

Is there a property in the Diagram? How to implement this feature?

In the sample projets, the Diagram is put in a ScrollViewer. Does the Diagram have its own scroll bar which can be shown when the display area is not big enough to display all the nodes?


Thanks a lot!
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How to make the Diagram bigger automatically?
Reply #1 - Feb 2nd, 2008 at 6:31am
Print Post  
Hi,

You can call the ResizeToFitItems method after adding items programmatically. The AutoResize property will enlarge the diagram if the user draws items near the borders.

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


I love YaBB 1G - SP1!

Posts: 24
Joined: Jun 5th, 2008
Re: How to make the Diagram bigger automatically?
Reply #2 - Jun 5th, 2008 at 2:27pm
Print Post  
Related to this, if I set the Diagram's VerticalAlignment and HorizontalAlignment properties to Stretch, it does not stretch to fill the container. Is there a better workaround for this than just setting its bounds to a large value?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How to make the Diagram bigger automatically?
Reply #3 - Jun 5th, 2008 at 4:07pm
Print Post  
The MSDN library says this about the Alignment properties:

Quote:
When Height and Width properties are explicitly set on an element, these measurements take higher precedent during layout and will cancel the typical effects of setting HorizontalAlignment to Stretch.


So, unfortunately Stretch is ignored since Wpfdiagram sets Width and Height internally based on the Bounds values. We'll try to enable using Stretch alignments for the next release.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint