Exemplo n.º 1
0
        public override void ScrollToValue(double position)
        {
            double num = this.ActualViewMaximum - this.ActualViewMinimum;
            double min = position;
            double max = position + num;

            RangeHelper.BoxRangeInsideAnother(ref min, ref max, this.ActualMinimum, this.ActualMaximum);
            double precision = DoubleHelper.GetPrecision(new double[2]
            {
                min,
                this.ActualViewMinimum
            });

            if (DoubleHelper.EqualsWithPrecision(min, this.ActualViewMinimum, precision))
            {
                return;
            }
            this._majorSequence.MoveToCover((DoubleR10)min, (DoubleR10)max);
            this.CalculateMinorSequence(this.MaxCount * 5, this.GetMaxAllowedMargin(this.MaxCount));
            this.BeginInit();
            this.ViewMinimum = new double?(this.ActualViewMinimum = min);
            this.ViewMaximum = new double?(this.ActualViewMaximum = max);
            this.IsScrolling = true;
            this.EndInit();
        }
Exemplo n.º 2
0
        public override void ScrollToValue(double position)
        {
            double num         = this.ActualViewMaximum - this.ActualViewMinimum;
            double viewMinimum = position;
            double viewMaximum = position + num;

            this.BoxViewRange(ref viewMinimum, ref viewMaximum);
            double precision = DoubleHelper.GetPrecision(new double[2]
            {
                viewMinimum,
                this.ActualViewMinimum
            });

            if (DoubleHelper.EqualsWithPrecision(viewMinimum, this.ActualViewMinimum, precision))
            {
                return;
            }
            this._majorSequence.MoveToCover((DoubleR10)viewMinimum, (DoubleR10)viewMaximum);
            this._minorSequence.MoveToCover((DoubleR10)viewMinimum, (DoubleR10)viewMaximum);
            this.BeginInit();
            this.ViewMinimum = new double?(this.ActualViewMinimum = viewMinimum);
            this.ViewMaximum = new double?(this.ActualViewMaximum = viewMaximum);
            this.IsScrolling = true;
            this.RealizeCategories();
            this.EndInit();
        }
Exemplo n.º 3
0
        public override void ZoomBy(double centerValue, double ratio)
        {
            double         num  = this.ConvertProjectedValueToPercent(centerValue);
            Range <double> view = this.ConvertActualViewToPercent();

            this.BoxZoomRatio(ref ratio, view);
            if (DoubleHelper.EqualsWithPrecision(ratio, 1.0, 0.001))
            {
                return;
            }
            this.ZoomToPercent(num - (num - view.Minimum) / ratio, num + (view.Maximum - num) / ratio);
        }