Esempio n. 1
0
        private void posImage(Viewport3DControl image, int index)
        {
            //  LayoutRoot.Children.Add(image);

            double diffFactor = index - _current;

            double left   = _xCenter + diffFactor * SpaceWidth - _touch_move_distance;
            double top    = 0.0;
            double Zindex = -Math.Abs(diffFactor) * 100;

            image.SetValue(Canvas.ZIndexProperty, (int)Zindex);
            double scalez = 1 - Math.Abs(diffFactor) * 0.07;

            // image.Width = ChildViewWidth;
            // image.Height = ChildViewHeight;

            if (index == _target)
            {
                double angle = (left - _xCenter) * 0.05;
                image.AnimationTransformTo(scalez, scalez, 1, angle);
                left += 30;
            }
            else if (index > _target)
            {
                image.AnimationTransformTo(scalez, scalez, 1, 8);
                left += 60;
            }
            else if (index < _target)
            {
                image.AnimationTransformTo(scalez, scalez, 1, -8); //-10
            }
            image.Opacity = 1 - Math.Abs(diffFactor) * OPACITY_DOWN_FACTOR;
            image.SetValue(Canvas.LeftProperty, left);
            image.SetValue(Canvas.TopProperty, top);
        }
Esempio n. 2
0
        private void posImage(Viewport3DControl image, int index)
        {
            double diffFactor = index - _current;

            double left = _xCenter + diffFactor * SpaceWidth - _touch_move_distance;
            double top  = 1.0;

            double Zindex = -Math.Abs(diffFactor) * 100;

            image.SetValue(Canvas.ZIndexProperty, (int)Zindex);

            if (index == _target)
            {
                left += 30;
                image.AnimationRotateTo(1, 1, 1, 0);
            }
            else if (index > _target)
            {
                left += 55;
                image.AnimationRotateTo(0.9, 0.9, 1, -45);
            }
            else if (index < _target)
            {
                image.AnimationRotateTo(0.9, 0.9, 1, 45);
            }

            image.Opacity = 1 - Math.Abs(diffFactor) * OPACITY_DOWN_FACTOR;
            image.SetValue(Canvas.LeftProperty, left);
            image.SetValue(Canvas.TopProperty, top);
        }