Hello,
I’m having hard time figure out how to implement Zoom To Fit function in the new GoXam.
I use Center for both horizontal and vertical content alignment to allow the user to freely move the diagram without the control keep center it for him.
I use this code to calculate the scale to see all the diagram:
private void ZoomToFitImpl() {
double heightRatio = diagram.Panel.ActualHeight / diagram.Panel.DiagramBounds.Height;
double widthRadio = diagram.Panel.ActualWidth / diagram.Panel.DiagramBounds.Width;
double ratioToUSe = Math.Min(heightRatio, widthRadio);
ZoomFactor = ratioToUSe;
}
The main problem is that I can't get it to scale the diagram on the initial display. Later invokation of this method scale the diagram right.
I still need to scroll the diagam I think but I didn't implement it yet.
Help will be great,
Thank you,
Ido.