Пример #1
0
        // Occurs when the slider position changes.
        private void slider_Scroll(object sender, EventArgs e)
        {
            if (parameter != null)
            {
                try
                {
                    if (parameter.IsWritable && !sliderMoving)
                    {
                        // Break any recursion if the value does not exactly match the slider value.
                        sliderMoving = true;

                        // Set the value.
                        parameter.SetValuePercentOfRange(SliderToPercentValue(slider.Value));
                    }
                }
                catch
                {
                    // Ignore any errors here.
                }
                finally
                {
                    sliderMoving = false;
                }
            }
        }
Пример #2
0
        private void slider_ValueChanged(object sender, RoutedPropertyChangedEventArgs <double> e)
        {
            if (parameter != null)
            {
                try
                {
                    // Break any recursion if the value does not exactly match the slider value.
                    //sliderMoving = true;

                    // Set the value.
                    parameter.SetValuePercentOfRange(SliderToPercentValue(slider.Value));
                }
                catch
                {
                    // Ignore any errors here.
                }
            }
        }