예제 #1
0
        protected override void OnMouseMove(MouseEventArgs e)
        {
            base.OnMouseMove(e);
            if (!isTouched)
            {
                return;
            }
            if (e.LeftButton == MouseButtonState.Released)
            {
                isTouched = false;
                return;
            }
            Point pt  = e.GetPosition(this);
            int   num = (int)((pt.X - Mar) / marAndWidth);

            if (num < 0)
            {
                num = 0;
            }
            else if (num >= MaxLedNum)
            {
                num = MaxLedNum;
            }
            SliderValueChanged?.Invoke(this, num);
        }
예제 #2
0
 protected override void StartTouch(PTouch args)
 {
     if (Contains(args))
     {
         SliderValueChanged?.Invoke(ValueFromPoint(args.Position));
     }
 }
        private void UpdateSlice(double value)
        {
            value           /= 100;
            SliderPercentage = value;
            SliderValueChanged.Raise(this);

            if (DataContext == null)
            {
                return;
            }

            var dataSource3D = (IUniformDataSource3D <Vector3D>)DataContext;

            var slice = CreateSection(dataSource3D, value);

            plotter.DataContext = slice;
            isoline.DataSource  = slice.GetMagnitudeDataSource();
        }
예제 #4
0
        protected override void OnMouseWheel(MouseWheelEventArgs e)
        {
            base.OnMouseWheel(e);
            if (!this.IsFocused)
            {
                return;
            }
            int num = LedNum + e.Delta / 120;

            if (num < 0)
            {
                num = 0;
            }
            else if (num >= MaxLedNum)
            {
                num = MaxLedNum;
            }
            SliderValueChanged?.Invoke(this, num);
        }
예제 #5
0
        protected override void OnMouseDown(MouseButtonEventArgs e)
        {
            this.Focus();
            this.CaptureMouse();
            Point pt  = e.GetPosition(this);
            int   num = (int)((pt.X - Mar) / marAndWidth);

            if (pt.X >= (num * marAndWidth /*+ Mar*/) && pt.X < this.ActualWidth - Mar /*((num + 1) * marAndWidth)*/)
            {
                if (num < 0)
                {
                    num = 0;
                }
                else if (num >= MaxLedNum)
                {
                    num = MaxLedNum;
                }
                isTouched = true;
                SliderValueChanged?.Invoke(this, num);
            }
        }
예제 #6
0
 private void Slider_ValueChanged(object sender, RoutedPropertyChangedEventArgs <double> e)
 {
     SliderValueChanged?.Invoke(sender, e);
 }
예제 #7
0
 public CSettingsSlider(SliderValueChanged valueChangeDelegate)
 {
     if (< > f__am$cache8 == null)
     {
예제 #8
0
 private void slider_ValueChanged(object sender, EventArgs e)
 {
     this.SliderValue = this.slider.Value;
     SliderValueChanged?.Invoke(sender, e);
 }
예제 #9
0
 private void OnSliderValueChange(EventArgs e)
 {
     SliderValueChanged?.Invoke(this, e);
 }
예제 #10
0
 void Handle_ValueChanged(object sender, Xamarin.Forms.ValueChangedEventArgs e)
 {
     SliderValueChanged?.Invoke(this, e.NewValue);
 }