="{Binding Path=Panel.Scale, ElementName=myDiagram}" is not working?

DiagramPanel.Scale is a dependency property, so you can data bind to it. In XAML: …="{Binding Path=Panel.Scale, ElementName=myDiagram}"

That should work. For example, here’s an example usage for that same dependency property:

<TextBlock Text="{Binding Path=Panel.Scale, ElementName=myDiagram, Converter={StaticResource theFormattingConverter}, ConverterParameter='\{0:F2\}'}" />

How to set MinimumScale and MaximumScale of Diagram according to Slider.
Tried setting

myDiagram.Panel.MinimumScale = myLogScaleSlider.Minimum;
myDiagram.Panel.MaximumScale = myLogScaleSlider.Maximum;

But it not works in sample OrgChart static.

What values were they? The MinimumScale must be greater than zero and less than or equal to one. The MaximumScale must be one or more.

In OrgChart example you have used slider to control zoom in & out. And also provided mouse wheel control.
Even though slider reaches on either ends you can zoom further. how to set maximum and minimum limit according to slider.


I would set the Slider’s properties based on the DiagramPanel’s properties.

myLogScaleSlider.Minimum = myDiagram.Panel.MinimumScale;
myLogScaleSlider.Maximum = myDiagram.Panel.MaximumScale;

Or set them both to some reasonable constant values.

I tried as you said but its not working as required? Can you please check? And provide sample


What values did it set?

OK, I just tried modifying the Org Chart’s log-scale Slider. All I did was add these two lines into the initialization of the slider:

        myLogScaleSlider.Minimum = Math.Log(myDiagram.Panel.MinimumScale, 2);
        myLogScaleSlider.Maximum = Math.Log(myDiagram.Panel.MaximumScale, 2);

Everything worked as I expected.

How do i set myDiagram.Panel.minimumScale. i.e., Graph should not become completely invisible.

That depends on how large your diagram/model is and how large your individual nodes and links are. I suggest you try various diagrams in your app and decide on what you think is a reasonable minimum and a reasonable maximum. Both should not be “too far” from 1.

Is this What you are saying?

myDiagram.Panel.MinimumScale = Math.Log(2, 2);
myDiagram.Panel.MaximumScale = Math.Log(-4, 2);

Probably not. You do know what those evaluate to, don’t you?

I cannot judge what you will find suitable for your app.

Ok i while try


Can you provide sample range for orgChart?

No, you can do that.