Hi
Is there a way to set the mininum/maximum width for the xamzoombar thumb so that it cannot be resized beyond that width?
Thanks,
Poornima
Hi Sharma,
I didn't make myself clear in my initial response. Scale is a property of the Range property of the xamZoombar, but it does not have a setter. Scale is controlled manually by the size and position of the thumb, which can be slide or sized. Or you can set the zoombar's Range properties, Minimum and Maximum values and the Scale will be calculated.
This site may be helpful to you to explain.
http://help.infragistics.com/doc/WPF/2013.2/CLR4.0/?page=xamZoombar_Getting_Started_with_xamZoombar.html
If you used the ZoomChangingEvent, you could interrogate the sender's Range as the initial position and the attribute's NewRange value. You would then know the initial range and the new range. Then you would have to determine if the difference between the NewRange's Minimum and Maximum value was less than you wanted to allow. At that point you could cancel the event or more likely you could set the NewRange values, calculating the appropriate values depending on whether the Minimum or Maximum values had changed. You would probably want some notification that the width of the thumb is being restricted.
The following code may be helpful to you.
void zoombarA_ZoomChanging(object sender, ZoomChangeEventArgs e)
{
Range currRange = (sender as XamZoombar).Range;
Range newRange = e.NewRange;
double minDif = .1;
if ((Math.Round(newRange.Maximum, 5) - Math.Round(newRange.Minimum, 5)) < minDif)
//e.Cancel = true;
if (Math.Round(newRange.Maximum, 5) != Math.Round(currRange.Maximum,5) )
newRange.Maximum = Math.Round(newRange.Minimum + minDif,5);
}
else
newRange.Minimum = Math.Round(newRange.Maximum - minDif, 5);
Please let me know if you have any questions.
hi Marianne,
can you please help me out on restricting minimum with for Zoombar thumb.
Regards,
hi, i am not able to find scale property on zoombar i just want to fix a minimum width value for the Zoombar thumb. there should be mionimum distance between left and right of zoombar thumb.
Kamlendra
Hi Poornima,
Please let me know if there is anything that I can help with further.
Hi,
I definitely feel that the feature would be helpful.
I had initially tried using the zoomchanging events and setting the Range of the xamzoombar, but facing some issues in it. I think I should be able to figure it out. Thanks.