Zoom to Fit

Hi,

I want to use InitialStretch = Uniform as it seems that this policy will not prohibit me for manually zooming above the range of 1.0. However the nodes are loaded dynamically by changing the model Nodesource. Is there any way to "reinitialize" or optionally can I set Stretch="Uniform" and somehow prevent the rescale behviour that seems to occur when zooming in more than what fits in the screen?

I suspect the easiest thing to do is to just:

myDiagram.Panel.Stretch = StretchPolicy.Uniform;
myDiagram.Panel.Stretch = StretchPolicy.Unstretched;

We have already added a DiagramPanel.ZoomToFit method for the next version, so that you don’t have to do such inelegant code.

Thanks that did the trick, at least when setting Unstretched after LayoutCompleted.

private void Model_Changed(object sender, ModelChangedEventArgs e)
{
if (myDiagram.Panel != null && e.Change == ModelChange.ChangedNodesSource)
{
myDiagram.Panel.Stretch = StretchPolicy.Uniform;
}
}
private void MyDiagramLayoutCompleted(object sender, DiagramEventArgs e)
{
myDiagram.Panel.Stretch = StretchPolicy.Unstretched;
}

I’m glad you figured out that you might need to delay resetting the DiagamPanel.Stretch property. I should have pointed out that possibility, since I hadn’t actually tried that code.

Hi walter

I can find this property at my end i am using 1.2.6.4 version of silverlight goxam.
I am trying to find it DiagramPanel.ZoomToFit .Is there any more new version available??

Not yet.