Наследование: RoutedEventArgs, IRangeBaseValueChangedEventArgs
Пример #1
0
 private void Slider_ValueChanged_2(object sender, Windows.UI.Xaml.Controls.Primitives.RangeBaseValueChangedEventArgs e)
 {
     if (voice != null)
     {
         voice.Volume = (float)(e.NewValue) / 100.0f;
     }
 }
 private void ZoomSlider_ValueChanged(object sender, RangeBaseValueChangedEventArgs e)
 {
     if (Control1 != null)
     {
         Control1.ChangeView(null, null, (float)e.NewValue);
     }
 }
Пример #3
0
 private async void brightness_ValueChanged(object sender, RangeBaseValueChangedEventArgs e)
 {
     if (!loadingPage) {
         var jsonString = "{\"bri\":" + e.NewValue + ",\"transitiontime\":0}";
         await HueAPIHelper.putLightChanges(jsonString, chosenLight.Id);
     }
 }
Пример #4
0
        private void ThicknessChanged(object sender, RangeBaseValueChangedEventArgs e)
        {
            if (mainCanvas == null)
                return;

            mainCanvas.ChangePenThickness(thickSelectSlider.Value);
        }
Пример #5
0
        //void videoElement_MediaOpened(object sender, RoutedEventArgs e)
        //{
        //    double absvalue = (int)Math.Round(
        //        ABC_song.NaturalDuration.TimeSpan.TotalSeconds,
        //        MidpointRounding.AwayFromZero);

        //    timelineSlider.Maximum = absvalue;

        //    timelineSlider.StepFrequency =
        //        SliderFrequency(ABC_song.NaturalDuration.TimeSpan);

        //    SetupTimer();

        //    // Helper method to populate the combobox with audio tracks.
        //    PopulateAudioTracks(videoMediaElement, cbAudioTracks);
        //}


        //Finally, this code shows the event handlers for pointer position changes and for the ValueChanged, CurrentStateChanged, and MediaEnded events.
        //C#
        //Copy

        //private bool _sliderpressed = false;

        //void slider_PointerEntered(object sender, PointerRoutedEventArgs e)
        //{
        //    _sliderpressed = true;
        //}

        //void slider_PointerCaptureLost(object sender, PointerRoutedEventArgs e)
        //{
        //    ABC_song.Position = TimeSpan.FromSeconds(timelineSlider.Value);
        //    _sliderpressed = false;
        //}

        void timelineSlider_ValueChanged(object sender, Windows.UI.Xaml.Controls.Primitives.RangeBaseValueChangedEventArgs e)
        {
            if (!_sliderpressed)
            {
                ABC_song.Position = TimeSpan.FromSeconds(e.NewValue);
            }
        }
Пример #6
0
 private void Slider_ValueChanged(object sender, RangeBaseValueChangedEventArgs e)
 {
     if (blockSliderChangeValue == e.NewValue || e.NewValue >= ViewModel.Instance.NowPlayingLength)
         blockSliderChangeValue = -1;
     else
         ViewModel.Instance.Seek(e.NewValue);
 }
Пример #7
0
 private void slider_ValueChanged(object sender, RangeBaseValueChangedEventArgs e)
 {
     double timeout = e.NewValue;
     SysInfo.Timeout = (int)timeout;
     timeout = timeout / 1000;
     textBoxTimeout.Text = timeout.ToString();
 }
Пример #8
0
 private void AcceleratorSliderValueChanged(object sender, RangeBaseValueChangedEventArgs e)
 {
     if (Device != null)
     {
         Device.SetSpeed(e.NewValue);
     }
 }
 private void RootBackgroundOpacitySlider_ValueChanged(object sender, RangeBaseValueChangedEventArgs e)
 {
     if (viewModel != null)
     {
         viewModel.UpdateOpacity(e.NewValue);
     }
 }
Пример #10
0
 private void SteeringSliderValueChanged(object sender, RangeBaseValueChangedEventArgs e)
 {
     if (Device != null)
     {
         Device.Steer(e.NewValue);
     }
 }
Пример #11
0
 private void ImageOpacitySliderValueChanged(object sender, RangeBaseValueChangedEventArgs e)
 {
     if (mapImage != null)
     {
         mapImage.Opacity = e.NewValue / 100;
     }
 }
Пример #12
0
 protected void brightnessSlider_ValueChanged(object sender, RangeBaseValueChangedEventArgs e)
 {
     Debug.WriteLine("Changing brightness to " + (1.0 - e.NewValue));
     Changes.Add(() => { Filter.Brightness = 1.0 - e.NewValue; });
     Apply();
     NotifyManipulated();
 }
Пример #13
0
        private void lightSatSlider_ValueChanged(object sender, RangeBaseValueChangedEventArgs e)
        {
            lightModel.sat = Convert.ToInt32(lightSatSlider.Value);

            Task.Run(async () => await apiManager.putLightState(lightModel));
            lightViewModel.UpdateLight(lightModel);
        }
        private void animationSpeed_ValueChanged(object sender, RangeBaseValueChangedEventArgs e)
        {
            if (this.AnimationCombo == null)
                return;

            fadeTile.AnimationDuration = (int)this.animationSpeed.Value;
        }
        void slider_ValueChanged(object sender, RangeBaseValueChangedEventArgs e)
#endif
        {
            if (ViewModel != null)
            {
                ViewModel.Volume = e.NewValue;
            }
        }
Пример #16
0
 /// <summary>
 /// 亮度调节
 /// </summary>
 private void sli_light_ValueChanged(object sender, Windows.UI.Xaml.Controls.Primitives.RangeBaseValueChangedEventArgs e)
 {
     if (lightinit)
     {
         border.Opacity = 1 - sli_light.Value;
         SettingHelper.SetValue("_light", sli_light.Value);
     }
 }
Пример #17
0
        private void Slider_ValueChanged(object sender, RangeBaseValueChangedEventArgs e)
        {


            this.light.Opacity = (100 - e.NewValue) / 100;


        }
Пример #18
0
 private void OnSliderChanged(object sender, RangeBaseValueChangedEventArgs e)
 {
     Debug.WriteLine("OnSliderChanged");
     if ((pca9685 != null) && (pca9685.IsInit))
     {
         pca9685.SetPWM(servonum, 0, (ushort)e.NewValue);
     }
 }
 private void MileSlider_ValueChanged(object sender, RangeBaseValueChangedEventArgs e)
 {
     MileContextDescription.Text = "Within " + MileSlider.Value.ToString("F2") + " miles of this stop";
     if (favorite == null) return;
     var list = favorite.Contexts.ToList();
     list.Where(ctxt => ctxt is DistanceContext).Select(ctxt => ((DistanceContext)ctxt).Distance = MileSlider.Value);
     favorite.Contexts = list.ToArray();
 }
 private void OnLightPositionZValueChanged(object sender, RangeBaseValueChangedEventArgs e)
 {
     if (_EffectRenderer == null) return;
     _EffectRenderer.SetLightingProperty(
         D2DLightingEffects.EffectRenderer.LightingProperty.LightPositionZ,
         (float)e.NewValue
     );
 }
 private void OnSpecularExponentValueChanged(object sender, RangeBaseValueChangedEventArgs e)
 {
     if (_EffectRenderer == null) return;
     _EffectRenderer.SetLightingProperty(
         D2DLightingEffects.EffectRenderer.LightingProperty.SpecularExponent,
         (float)e.NewValue
     );
 }
Пример #22
0
 /// <summary>
 /// 音量调节
 /// </summary>
 private void sli_vol_ValueChanged(object sender, Windows.UI.Xaml.Controls.Primitives.RangeBaseValueChangedEventArgs e)
 {
     if (isInited)
     {
         media.Volume = sli_vol.Value * 0.1;
         SettingHelper.SetValue("_vol", sli_vol.Value);
     }
 }
Пример #23
0
 private void LineWidthSlider_ValueChanged(object sender, RangeBaseValueChangedEventArgs args)
 {
     var eventHandler = this.ValueChanged;
     if (eventHandler != null)
     {
         eventHandler(this, args);
     }
 }
Пример #24
0
 private void sli_speed_ValueChanged(object sender, Windows.UI.Xaml.Controls.Primitives.RangeBaseValueChangedEventArgs e)
 {
     SettingHelper.SetValue("_speed", sli_speed.Value);
     if (isInited)
     {
         danmaku.ChangeSpeed(15 - (int)sli_speed.Value);
     }
 }
 private void RadiusSlider_ValueChanged(object sender, Windows.UI.Xaml.Controls.Primitives.RangeBaseValueChangedEventArgs e)
 {
     if (LayoutPanel == null)
     {
         return;
     }
     LayoutPanel.Width = LayoutPanel.Height = e.NewValue;
 }
 private async void Brightness_ValueChanged(object sender, RangeBaseValueChangedEventArgs e)
 {
     if (_lampState != null)
     {
         var value = Convert.ToUInt32(UInt32.MaxValue * (e.NewValue / 100.0));
         await _lampState.SetBrightnessAsync(value);
     }
 }
Пример #27
0
 private void rgb_ValueChanged(object sender, Windows.UI.Xaml.Controls.Primitives.RangeBaseValueChangedEventArgs e)
 {
     try
     {
         rec.Fill = new SolidColorBrush(Color.FromArgb(255, byte.Parse(r.Text), byte.Parse(g.Text), byte.Parse(b.Text)));
     }
     catch { }
 }
 private void Slider_ValueChanged(object sender, RangeBaseValueChangedEventArgs e) {
     Slider slider = sender as Slider;
     Panel parentPanel = slider.Parent as Panel;
     int childIndex = parentPanel.Children.IndexOf(slider);
     TextBlock txtblk = parentPanel.Children[childIndex + 1] as TextBlock;
     //txtblk.Text = e.NewValue.ToString();
     txtblk.Text = slider.Value.ToString();
 }
 private void MySlider_ValueChanged(object sender, RangeBaseValueChangedEventArgs e)
 {
     // Display the rotation value in the Label formatted nicely with degree symbol.
     MyTextBlock.Text = string.Format("{0:0}°", MySlider.Value);
    
     // Set the MapView rotation to that of the Slider.
     MyMapView.SetViewpointRotationAsync(e.NewValue);           
 }
    // Not used now - replaced by databinding
    private void PitchSliderOnValueChanged(object sender, RangeBaseValueChangedEventArgs e)
    {
      //Only effective on ZoomLevel 7 and higher!
      MyMap.DesiredPitch = e.NewValue;

      // Does not work - read only
      // MyMap.Pitch = e.NewValue;
    }
 private void SliderBlue_ValueChanged(object sender, RangeBaseValueChangedEventArgs e)
 {
     if (d3dApp == null)
         return;
     Windows.UI.Color c = d3dApp.Color;
     c.B = (byte)e.NewValue;
     d3dApp.Color = c;
 }
Пример #32
0
        void progressbar_ValueChanged(object sender, Windows.UI.Xaml.Controls.Primitives.RangeBaseValueChangedEventArgs e)
        {
            NowPlayingViewModel viewModel = (NowPlayingViewModel)DataContext;

            if (!viewModel.sliderpressed)
            {
                viewModel.SendMessage(AppConstants.Position, TimeSpan.FromSeconds(e.NewValue));
            }
        }
Пример #33
0
        private void ZoomSlider_ValueChanged(object sender, Windows.UI.Xaml.Controls.Primitives.RangeBaseValueChangedEventArgs e)
        {
            if (_settingUpUi)
            {
                return;
            }

            SetZoomLevel((float)ZoomSlider.Value);
        }
Пример #34
0
        private async void EffectRangeSlider_OnValueChanged(object sender, RangeBaseValueChangedEventArgs e)
        {
            if (this.renderer != null)
            {
                this.viewModel.blur.KernelSize = (int)e.NewValue;

                await this.renderer.RenderAsync();
            }
        }
Пример #35
0
 private void sli_space_ValueChanged(object sender, Windows.UI.Xaml.Controls.Primitives.RangeBaseValueChangedEventArgs e)
 {
     SettingHelper.SetValue("_space", sli_space.Value);
     // 注意:由于预定义了value值,初始化时会引发ValueChanged事件
     if (isInited)
     {
         danmaku.ChangeSpace((int)sli_space.Value);
     }
 }
Пример #36
0
 private void itProgBr_ValueChanged(object sender, Windows.UI.Xaml.Controls.Primitives.RangeBaseValueChangedEventArgs e)
 {
     if (dtInvalidate != null)
     {
         //_sbHideBgLayer?.Begin();
         //dtInvalidate.Start();
         //Invalidate();
     }
 }
Пример #37
0
        private void SaturationSlider_ValueChanged(object sender, RangeBaseValueChangedEventArgs e)
        {
            HSBColorSource.S = (float)SaturationSlider.Value;
            SaturationSliderHighlightBrush.Color = HSBColor.FromHSB(HSBColorSource);

            if (ValueChanged != null)
            {
                ValueChanged(this, null);
            }
        }
Пример #38
0
        private void BrightnessSlider_ValueChanged(object sender, RangeBaseValueChangedEventArgs e)
        {
            LightSource.Brightness = (int)BrightnessSlider.Value;
            BridgeManager.Instance.InvalidateLightProperties(LightSource);

            SaturationSliderHighlightBrush.Color = HSBColor.FromHSB(LightSource.Hue, LightSource.Saturation, LightSource.Brightness);

            var attrs = new { bri = LightSource.Brightness };
            UpdateLightStateAsync(attrs);
        }
Пример #39
0
 private void ScaleSlider_ValueChanged(object sender, Windows.UI.Xaml.Controls.Primitives.RangeBaseValueChangedEventArgs e)
 {
     // Ignore any value changed events the control is set up and we are accepting user input.
     if ((ScaleSlider != null) && (ScaleSlider.IsEnabled == true))
     {
         // The slider control uses percentages (0 to 100) while m_scaleFactor is a coefficient (0 to 1).
         m_scaleFactor = e.NewValue / 100;
         UpdateImageDimensionsUI();
     }
 }
        private void slider1_ValueChanged(object sender, RangeBaseValueChangedEventArgs e)
        {
            if (!sendControls) return;

            App.ledStripController.Fade(
                (uint)slider1.Value,
                (uint)slider2.Value,
                (uint)slider3.Value,
                stripChangeColorTime);
        }
Пример #41
0
        private void sli_fontsize_ValueChanged(object sender, Windows.UI.Xaml.Controls.Primitives.RangeBaseValueChangedEventArgs e)
        {
            int value = (int)sli_fontsize.Value;

            SettingHelper.SetValue("_fontsize", value);
            if (isInited)
            {
                danmaku.ChangeSize(value);
            }
        }
Пример #42
0
        private void ProcessorCount_ValueChanged(object sender, Windows.UI.Xaml.Controls.Primitives.RangeBaseValueChangedEventArgs e)
        {
            double processorCountValue = processorCount.Value;

            if (Convert.ToBoolean(processorCountValue % 2))
            {
                processorCountValue++;
                processorCount.Value = processorCountValue;
            }
            processorCountLabel.Text = "Amount of virtual processors to split the tasks: " + processorCountValue;
        }
Пример #43
0
        private async void FocusSlider_ValueChanged(object sender, Windows.UI.Xaml.Controls.Primitives.RangeBaseValueChangedEventArgs e)
        {
            if (_settingUpUi)
            {
                return;
            }

            var value = (sender as Slider).Value;

            await mediaCapture.VideoDeviceController.FocusControl.SetValueAsync((uint)value);
        }
    // -------------------- 'ADVANCED' MANIPULATION -----------------------

    // Not used now - replaced by databinding
    private void RotationSliderOnValueChanged(object sender, 
                 RangeBaseValueChangedEventArgs e)
    {
      MyMap.TryRotateToAsync(e.NewValue);

      //Same result, sans the cool animation.
      MyMap.Heading = e.NewValue;

      //Rotates BY a certain value.
      MyMap.TryRotateAsync(e.NewValue);
    }
        /// <summary>
        /// This Slider ValueChanged event changes the price of every car in the Cars collection
        /// </summary>
        private void RangeBase_OnValueChanged(object sender, RangeBaseValueChangedEventArgs e)
        {
            var vm = this.DataContext as MainViewModel;

            var isPositiveChange = e.NewValue - e.OldValue > 0;

            foreach (var car in vm.Cars)
            {
                car.Price = isPositiveChange ? car.Price + e.NewValue : car.Price - e.NewValue;
            }
        }
        private void PlayerAmountSlider_ValueChanged(object sender, Windows.UI.Xaml.Controls.Primitives.RangeBaseValueChangedEventArgs e)
        {
            int sliderValue = Convert.ToInt32(e.NewValue);

            _playerAmount = sliderValue;
            string labelText = String.Format("Amount of players: {0}", _playerAmount);

            if (this.playerAmountLabel != null)
            {
                this.playerAmountLabel.Text = labelText;
            }
        }
Пример #47
0
        private async void WbSlider_ValueChanged(object sender, Windows.UI.Xaml.Controls.Primitives.RangeBaseValueChangedEventArgs e)
        {
            var value = (sender as Slider).Value;

            if (_webcamMediaCapture.VideoDeviceController.WhiteBalanceControl.Supported)
            {
                await _webcamMediaCapture.VideoDeviceController.WhiteBalanceControl.SetValueAsync((uint)value);
            }
            else
            {
                _webcamMediaCapture.VideoDeviceController.WhiteBalance.TrySetValue(value);
            }
        }
Пример #48
0
 internal void sldContrast_ValueChanged(Object sender, Windows.UI.Xaml.Controls.Primitives.RangeBaseValueChangedEventArgs e)
 {
     try
     {
         bool succeeded = m_mediaCaptureMgr.VideoDeviceController.Contrast.TrySetValue(sldContrast.Value);
         if (!succeeded)
         {
             //ShowStatusMessage("Set Contrast failed");
         }
     }
     catch (Exception exception)
     {
         //ShowExceptionMessage(exception);
     }
 }
Пример #49
0
        private void GameAmountSlider_ValueChanged(object sender, Windows.UI.Xaml.Controls.Primitives.RangeBaseValueChangedEventArgs e)
        {
            decimal sliderValue        = Convert.ToDecimal(e.NewValue);
            decimal roundedSliderValue = Math.Round(sliderValue / 100, 0) * 100;

            _gameAmount = Convert.ToInt32(roundedSliderValue);
            Slider slider = (Slider)sender;

            slider.Value = _gameAmount;
            string labelText = String.Format("Amount of games: {0}", _gameAmount);

            if (this.gameAmountLabel != null)
            {
                this.gameAmountLabel.Text = labelText;
            }
        }
Пример #50
0
        private void slider_ValueChanged(object sender, Windows.UI.Xaml.Controls.Primitives.RangeBaseValueChangedEventArgs e)
        {
            UIElementCollection g = grid.Children;

            foreach (var item in g)
            {
                if (item is Grid)
                {
                    grid.Children.Remove(item);
                }
            }
            double radius = 100;
            byte   type   = (Byte)slider.Value;

            DrawColorWheel(50, 60, radius, radius * 0.6, type);
        }
Пример #51
0
 private async void Slider_ValueChanged(object sender, Windows.UI.Xaml.Controls.Primitives.RangeBaseValueChangedEventArgs e)
 {
     await MainPageViewModel.SetVolume(e.NewValue);
 }
Пример #52
0
 private void Slider_ValueChanged_1(object sender, Windows.UI.Xaml.Controls.Primitives.RangeBaseValueChangedEventArgs e)
 {
     frequency = (float)e.NewValue;
 }
Пример #53
0
 private void BrightnessController_ValueChanged(object sender, Windows.UI.Xaml.Controls.Primitives.RangeBaseValueChangedEventArgs e)
 {
     Camera.AdjustBrightness(e.NewValue);
 }
Пример #54
0
 private void sSlider_ValueChanged(object sender, Windows.UI.Xaml.Controls.Primitives.RangeBaseValueChangedEventArgs e)
 {
     ledRed.Fill   = (Convert.ToDouble(e.NewValue));
     tblValue.Text = $"You set {ledRed.Fill}% fill";
 }
Пример #55
0
 private void sSlider_ValueChanged(object sender, Windows.UI.Xaml.Controls.Primitives.RangeBaseValueChangedEventArgs e)
 {
     servo.Set(Convert.ToDouble(e.NewValue), PwmServo.ServoPwmInputType.ServoFill);
     tblValue.Text = $"You set {servo.Fill}% fill";
 }
Пример #56
0
 private void rotationSlider_ValueChanged(object sender, Windows.UI.Xaml.Controls.Primitives.RangeBaseValueChangedEventArgs e)
 {
     MyMapView.SetRotation(e.NewValue);
 }
Пример #57
0
 //change the volume of the media
 private void ChangeMediaVolume(object sender, Windows.UI.Xaml.Controls.Primitives.RangeBaseValueChangedEventArgs e)
 {
     myMediaElement.Volume = (double)volumeSlider.Value;
 }
Пример #58
0
 private void sSlider_ValueChanged(object sender, Windows.UI.Xaml.Controls.Primitives.RangeBaseValueChangedEventArgs e)
 {
     mojLed2.Fill  = Convert.ToDouble(e.NewValue / 100);
     tblValue.Text = $"You set {e.NewValue / 100} fill on pwm";
 }
Пример #59
0
 private void ExpositionController_ValueChanged(object sender, Windows.UI.Xaml.Controls.Primitives.RangeBaseValueChangedEventArgs e)
 {
     Camera.AdjustExposition(e.NewValue);
 }