示例#1
0
        private void DoScrollToTopOrBottom(bool toBottom, Action onCompletedCallback)
        {
            Rect   rect;
            double num1;

            if (!toBottom)
            {
                num1 = 0.0;
            }
            else
            {
                rect = this._vpCtrl.Bounds;
                // ISSUE: explicit reference operation
                num1 = rect.Bottom - ((FrameworkElement)this._vpCtrl).ActualHeight;
            }
            double           to = num1;
            ViewportMediator viewportMediator = new ViewportMediator();

            viewportMediator.ViewportControl = this._vpCtrl;
            this._vpCtrl.ViewportChanged    -= (new EventHandler <ViewportChangedEventArgs>(this._vpCtrl_ViewportChanged));
            rect = this._vpCtrl.Viewport;
            // ISSUE: explicit reference operation
            double             y   = rect.Y;
            double             to1 = to;
            DependencyProperty verticalOffsetProperty = ViewportMediator.VerticalOffsetProperty;
            int       duration  = 250;
            int?      startTime = new int?(0);
            CubicEase cubicEase = new CubicEase();
            Action    completed = (Action)(() =>
            {
                ViewportControl vpCtrl = this._vpCtrl;
                Rect viewport = this._vpCtrl.Viewport;
                // ISSUE: explicit reference operation
                Point point = new Point(((Rect)@viewport).X, to);
                vpCtrl.SetViewportOrigin(point);
                this._vpCtrl.ViewportChanged += (new EventHandler <ViewportChangedEventArgs>(this._vpCtrl_ViewportChanged));
                if (onCompletedCallback == null)
                {
                    return;
                }
                onCompletedCallback();
            });
            int num2 = 0;

            ((DependencyObject)viewportMediator).Animate(y, to1, verticalOffsetProperty, duration, startTime, cubicEase, completed, num2 != 0);
        }
示例#2
0
        private void DoScrollToTopOrBottom(bool toBottom, Action onCompletedCallback)
        {
            Rect   rect;
            double num1;

            if (!toBottom)
            {
                num1 = 0.0;
            }
            else
            {
                rect = this._vpCtrl.Bounds;
                num1 = rect.Bottom - this._vpCtrl.ActualHeight;
            }
            double           to     = num1;
            ViewportMediator target = new ViewportMediator();

            target.ViewportControl        = this._vpCtrl;
            this._vpCtrl.ViewportChanged -= new EventHandler <ViewportChangedEventArgs>(this._vpCtrl_ViewportChanged);
            rect = this._vpCtrl.Viewport;
            double             y   = rect.Y;
            double             to1 = to;
            DependencyProperty dependencyProperty = ViewportMediator.VerticalOffsetProperty;
            int       duration  = 250;
            int?      startTime = new int?(0);
            CubicEase cubicEase = new CubicEase();
            Action    completed = (Action)(() =>
            {
                this._vpCtrl.SetViewportOrigin(new Point(this._vpCtrl.Viewport.X, to));
                this._vpCtrl.ViewportChanged += new EventHandler <ViewportChangedEventArgs>(this._vpCtrl_ViewportChanged);
                if (onCompletedCallback == null)
                {
                    return;
                }
                onCompletedCallback();
            });
            int num2 = 0;

            target.Animate(y, to1, (object)dependencyProperty, duration, startTime, (IEasingFunction)cubicEase, completed, num2 != 0);
        }
示例#3
0
        private static void OnVerticalOffsetChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ViewportMediator viewportMediator = d as ViewportMediator;

            viewportMediator.ViewportControl.SetViewportOrigin(new Point(0.0, viewportMediator.VerticalOffset));
        }