Limit scale values

Hello,

Now i have
uxdgm_Diagram.TemplateApplied += (s, e) =>
{
var b = new System.Windows.Data.Binding(“Scale”);
b.Source = uxdgm_Diagram.Panel;
b.Mode = System.Windows.Data.BindingMode.TwoWay;
b.Converter = new ZoomConverter();
uxsl_zoom.SetBinding(Slider.ValueProperty, b);
};

(Thanks to before post).

but i have a problem. How could i fix the scale values beween 0.5 and 1.5.

If the user use the mouse wheel the scale ( zoom in) can not be bigger to 1.5

Thanks

I have found the solution.

        uxdgm_Diagram.TemplateApplied += (s, e) =>
        {
            var b = new System.Windows.Data.Binding("Scale");
            b.Source = uxdgm_Diagram.Panel;
            b.Mode = System.Windows.Data.BindingMode.TwoWay;
            b.Converter = new ZoomConverter();
            uxsl_zoom.SetBinding(Slider.ValueProperty, b);               
            uxsl_zoom.ValueChanged+=new RoutedPropertyChangedEventHandler<double>(uxsl_zoom_ValueChanged);
            uxdgm_Diagram.Panel.MaximumScale = 1.5;
            uxdgm_Diagram.Panel.MinimumScale = 0.5;

        };

Thanks!.

By the way, for anyone else who might want to do this in XAML, you would normally do so by customizing the Diagram.Template, a ControlTemplate, as you would for any Control.

Copy and adapt the default Diagram ControlTemplate, which you will find in the Generic*.XAML file in the docs subdirectory.