Hi Team,
Thanks for your help and support. I did the slider left right zoom in ,zoom out But now i am facing another problem, While clicking the slider button the slider is doing zoom in zoom out but when i close the slider and open once again then again the slider is open from the start , The slider should be start from the previous place where i left the slider and close it.
I want the solution for this how i will open the slider again for the same position where i left the slider .
Please help me.
Here is my code.
private void Zoom_slider_Click(object sender, RoutedEventArgs e)
{
RadWindow Zoom_slider_window = new RadWindow();
Zoom_slider_window.Header = "Zoom Slider";
Zoom_slider_window.Height = 100;
Zoom_slider_window.Width = 300;
Zoom_slider_window.WindowStartupLocation = Telerik.Windows.Controls.WindowStartupLocation.CenterOwner;
Zoom_slider_window.ResizeMode = ResizeMode.NoResize;
Pre_grid.Children.Add(Zoom_slider_window);
Zoom_slider_window.Show();
//Now add a slider to window
Zoomslider = new RadSlider();
Zoomslider.VerticalAlignment = System.Windows.VerticalAlignment.Center;
Zoomslider.TickPlacement = TickPlacement.Both;
Zoomslider.TickFrequency = 2;
Zoomslider.HandlesVisibility = System.Windows.Visibility.Visible;
Zoom_slider_window.Content = Zoomslider;
Zoomslider.Maximum = 10;
Zoomslider.Minimum = 1;
Zoomslider.SmallChange = 0.3;
if (Zoomslider.Value != null)
{
Zoomslider.SelectionStart = oldZoomValue;
}
Zoomslider.Value = 1;
//Event handling
Zoomslider.ValueChanged+=new RoutedPropertyChangedEventHandler<double>(Zoomslider_ValueChanged);
}
private static double oldZoomValue=0;
private void Zoomslider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
if (Zoomslider.Value < oldZoomValue)
{
ZoomOut();
}
else
{
if (Zoomslider.Value > Zoomslider.Minimum)
{
ZoomIn();
}
}
oldZoomValue = Zoomslider.Value;
}