Example #1
0
        private void OnSliderValueChanged(object sender, RoutedPropertyChangedEventArgs <double> e)
        {
            if (reset)
            {
                reset             = false;
                CurrentValue.Text = "0";
                return;
            }

            doubleValue = GetSliderValue();
            intValue    = Convert.ToInt32(doubleValue);

            if (doubleValue != lastVal)
            {
                Logger.LogInfo("Slider-OnSliderValueChanged", doubleValue.ToString());


                ValueChanged = true;
                lastVal      = doubleValue;
                if (numSliderMode == SliderMode.Integer)
                {
                    CurrentValue.Text = intValue.ToString();
                }
                else
                {
                    CurrentValue.Text = doubleValue.ToString();
                }

                // Slider value changed needs to be handled by the class containing the slider
                // In this case it is the NumericSliderExtension class
                if (null != UpdateSliderValue)
                {
                    UpdateSliderValue(this, e);
                }

                // Updates the UI for the current script to show the change in TextBuffer.
                textEditorControl.UpdateUiForModifiedScript(Solution.Current.ActiveScript);
            }
        }