Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Diagram not resizing inside Ruler. (Read 2131 times)
venki5star
Junior Member
**
Offline



Posts: 82
Location: India
Joined: Mar 9th, 2010
Diagram not resizing inside Ruler.
Apr 15th, 2010 at 6:44am
Print Post  
Hi,
I have a diagram placed inside the ruler. If the window's width is 1000, then the ruler automatically fills in the width, but not the diagram.
It is always aligned in the middle of the ruler.

How do i make the diagram fill the ruler?

Sent you a sample project for this (from email surendra@eagle-india.com)

Please help.
  

Castle Rider
Back to top
WWW  
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Diagram not resizing inside Ruler.
Reply #1 - Apr 15th, 2010 at 11:21am
Print Post  
Hi,

The size of the diagram depends only on its Bounds property. You could handle the SizeChanged event raised for the diagram’s container - Ruler or Scroll Viewer - and set larger Bounds value if you detect it's smaller than the container's ActualWidth / ActualHeight.

Stoyan
  
Back to top
 
IP Logged
 
venki5star
Junior Member
**
Offline



Posts: 82
Location: India
Joined: Mar 9th, 2010
Re: Diagram not resizing inside Ruler.
Reply #2 - Apr 15th, 2010 at 1:07pm
Print Post  
Hi,

It doesn't seem to solve the problem, i have sent you one sample in which i tried.

Please help.
  

Castle Rider
Back to top
WWW  
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Diagram not resizing inside Ruler.
Reply #3 - Apr 16th, 2010 at 12:43pm
Print Post  
Change this line:
MyDiagram.Bounds = MyRuler.Document.Bounds;

which assigns diagram.Bounds to itself, to:

var scrollViewer = MyDiagram.Parent as ScrollViewer;
var b = MyDiagram.Bounds;
if (scrollViewer != null)
{
     MyDiagram.Bounds = new Rect(0, 0,
           Math.Max(scrollViewer.ActualWidth, b.Width),
           Math.Max(scrollViewer.ActualHeight, b.Height));
}

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
venki5star
Junior Member
**
Offline



Posts: 82
Location: India
Joined: Mar 9th, 2010
Re: Diagram not resizing inside Ruler.
Reply #4 - Apr 16th, 2010 at 12:49pm
Print Post  
This fixed the issue.

Thanks Stoyan.
  

Castle Rider
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint