Example #1
0
        private void HideRecordingEllipse()
        {
            List <AnimationInfo> animInfoList = new List <AnimationInfo>();

            animInfoList.Add(new AnimationInfo()
            {
                target       = (DependencyObject)this.scaleVolume,
                propertyPath = ScaleTransform.ScaleXProperty,
                from         = this.scaleVolume.ScaleX,
                to           = 0.0,
                duration     = 200
            });
            animInfoList.Add(new AnimationInfo()
            {
                target       = (DependencyObject)this.scaleVolume,
                propertyPath = ScaleTransform.ScaleYProperty,
                from         = this.scaleVolume.ScaleY,
                to           = 0.0,
                duration     = 200
            });
            int?startTime = new int?();

            // ISSUE: variable of the null type

            AnimationUtil.AnimateSeveral(animInfoList, startTime, null);
            ((UIElement)this.ellipseRec).Opacity = 0.0;
        }
Example #2
0
        private void RunAnimation(Action callback)
        {
            List <AnimationInfo> animInfoList   = new List <AnimationInfo>();
            AnimationInfo        animationInfo1 = new AnimationInfo();

            animationInfo1.duration = PreviewBehavior.PUSH_ANIMATION_DURATION;
            animationInfo1.easing   = PreviewBehavior.PUSH_ANIMATION_EASING;
            double scaleX = (((UIElement)this.imagePreview).RenderTransform as ScaleTransform).ScaleX;

            animationInfo1.from = scaleX;
            double num1 = 1.0;

            animationInfo1.to = num1;
            Transform renderTransform1 = ((UIElement)this.imagePreview).RenderTransform;

            animationInfo1.target = (DependencyObject)renderTransform1;
            // ISSUE: variable of the null type
            animationInfo1.propertyPath = ScaleTransform.ScaleXProperty;
            animInfoList.Add(animationInfo1);
            AnimationInfo animationInfo2 = new AnimationInfo();

            animationInfo2.duration = PreviewBehavior.PUSH_ANIMATION_DURATION;
            animationInfo2.easing   = PreviewBehavior.PUSH_ANIMATION_EASING;
            double scaleY = (((UIElement)this.imagePreview).RenderTransform as ScaleTransform).ScaleY;

            animationInfo2.from = scaleY;
            double num2 = 1.0;

            animationInfo2.to = num2;
            Transform renderTransform2 = ((UIElement)this.imagePreview).RenderTransform;

            animationInfo2.target = (DependencyObject)renderTransform2;
            // ISSUE: variable of the null type
            animationInfo2.propertyPath = ScaleTransform.ScaleYProperty;
            animInfoList.Add(animationInfo2);
            AnimationInfo animationInfo3 = new AnimationInfo();

            animationInfo3.duration = PreviewBehavior.PUSH_ANIMATION_DURATION;
            animationInfo3.easing   = PreviewBehavior.PUSH_ANIMATION_EASING;
            double opacity = ((UIElement)this.rect).Opacity;

            animationInfo3.from = opacity;
            double num3 = 0.4;

            animationInfo3.to = num3;
            Rectangle rect = this.rect;

            animationInfo3.target = (DependencyObject)rect;
            // ISSUE: variable of the null type
            animationInfo3.propertyPath = UIElement.OpacityProperty;
            animInfoList.Add(animationInfo3);
            int?   startTime = new int?(0);
            Action completed = (Action)(() =>
            {
                this._animationRan = true;
                callback();
            });

            AnimationUtil.AnimateSeveral(animInfoList, startTime, completed);
        }
Example #3
0
        private void DecibelValue_OnChanged(double percentage)
        {
            double num = 0.7 + percentage * 0.5;
            List <AnimationInfo> animInfoList = new List <AnimationInfo>();

            animInfoList.Add(new AnimationInfo()
            {
                target       = (DependencyObject)this.scaleVolume,
                propertyPath = ScaleTransform.ScaleXProperty,
                from         = this.scaleVolume.ScaleX,
                to           = num,
                duration     = 200
            });
            animInfoList.Add(new AnimationInfo()
            {
                target       = (DependencyObject)this.scaleVolume,
                propertyPath = ScaleTransform.ScaleYProperty,
                from         = this.scaleVolume.ScaleY,
                to           = num,
                duration     = 200
            });
            int?startTime = new int?();

            // ISSUE: variable of the null type

            AnimationUtil.AnimateSeveral(animInfoList, startTime, null);
        }
        private void AnimateTwoElementsOnDragComplete(FrameworkElement element1, FrameworkElement element2, double delta, Action completedCallback, bool movingToNextOrPrevious)
        {
            int num = movingToNextOrPrevious ? 200 : 175;
            List <AnimationInfo> animInfoList     = new List <AnimationInfo>();
            TranslateTransform   renderTransform1 = ((UIElement)element1).RenderTransform as TranslateTransform;
            TranslateTransform   renderTransform2 = ((UIElement)element2).RenderTransform as TranslateTransform;

            animInfoList.Add(new AnimationInfo()
            {
                from         = renderTransform1.X,
                to           = renderTransform1.X + delta,
                propertyPath = TranslateTransform.XProperty,
                duration     = num,
                target       = (DependencyObject)renderTransform1,
                easing       = GamesCatalogBannersSlideView.ANIMATION_EASING
            });
            animInfoList.Add(new AnimationInfo()
            {
                from         = renderTransform2.X,
                to           = renderTransform2.X + delta,
                propertyPath = TranslateTransform.XProperty,
                duration     = num,
                target       = (DependencyObject)renderTransform2,
                easing       = GamesCatalogBannersSlideView.ANIMATION_EASING
            });
            int?   startTime = new int?(0);
            Action completed = completedCallback;

            AnimationUtil.AnimateSeveral(animInfoList, startTime, completed);
        }
        private void AnimateTwoElementsOnDragComplete(FrameworkElement element1, FrameworkElement element2, double delta, Action completedCallback, bool movingToNextOrPrevious)
        {
            int num = movingToNextOrPrevious ? 200 : 175;
            List <AnimationInfo> animInfoList        = new List <AnimationInfo>();
            TranslateTransform   translateTransform1 = element1.RenderTransform as TranslateTransform;
            TranslateTransform   translateTransform2 = element2.RenderTransform as TranslateTransform;

            animInfoList.Add(new AnimationInfo()
            {
                from         = translateTransform1.X,
                to           = translateTransform1.X + delta,
                propertyPath = (object)TranslateTransform.XProperty,
                duration     = num,
                target       = (DependencyObject)translateTransform1,
                easing       = SwipeThroughControl.ANIMATION_EASING
            });
            animInfoList.Add(new AnimationInfo()
            {
                from         = translateTransform2.X,
                to           = translateTransform2.X + delta,
                propertyPath = (object)TranslateTransform.XProperty,
                duration     = num,
                target       = (DependencyObject)translateTransform2,
                easing       = SwipeThroughControl.ANIMATION_EASING
            });
            int?   startTime = new int?(0);
            Action completed = completedCallback;

            AnimationUtil.AnimateSeveral(animInfoList, startTime, completed);
        }
Example #6
0
        private void ShowHideCancelOverlay(bool show)
        {
            if (this._isAnimatingCancel)
            {
                return;
            }
            List <AnimationInfo> animInfoList = null;

            if (show && ((UIElement)this.borderCancel).Opacity < 1.0)
            {
                List <AnimationInfo> animationInfoList = new List <AnimationInfo>();
                AnimationInfo        animationInfo     = new AnimationInfo();
                animationInfo.target       = (DependencyObject)this.borderCancel;
                animationInfo.propertyPath = UIElement.OpacityProperty;
                animationInfo.from         = ((UIElement)this.borderCancel).Opacity;
                animationInfo.to           = 1.0;
                CubicEase cubicEase = new CubicEase();
                int       num1      = 0;
                ((EasingFunctionBase)cubicEase).EasingMode = ((EasingMode)num1);
                animationInfo.easing = (IEasingFunction)cubicEase;
                int num2 = 100;
                animationInfo.duration = num2;
                animationInfoList.Add(animationInfo);
                animInfoList = animationInfoList;
            }
            else if (!show && ((UIElement)this.borderCancel).Opacity > 0.0)
            {
                List <AnimationInfo> animationInfoList = new List <AnimationInfo>();
                AnimationInfo        animationInfo     = new AnimationInfo();
                animationInfo.target       = (DependencyObject)this.borderCancel;
                animationInfo.propertyPath = UIElement.OpacityProperty;
                animationInfo.from         = ((UIElement)this.borderCancel).Opacity;
                animationInfo.to           = 0.0;
                CubicEase cubicEase = new CubicEase();
                int       num1      = 0;
                ((EasingFunctionBase)cubicEase).EasingMode = ((EasingMode)num1);
                animationInfo.easing = (IEasingFunction)cubicEase;
                int num2 = 100;
                animationInfo.duration = num2;
                animationInfoList.Add(animationInfo);
                animInfoList = animationInfoList;
            }
            if (animInfoList == null)
            {
                return;
            }
            this._isAnimatingCancel = true;
            AnimationUtil.AnimateSeveral(animInfoList, new int?(), (Action)(() =>
            {
                this._isAnimatingCancel = false;
                if (((UIElement)this.borderCancel).Opacity < 1.0)
                {
                    ((Shape)this.ellipseVolume).Fill = ((Brush)Application.Current.Resources["PhoneBlue300_GrayBlue400Brush"]);
                }
                else
                {
                    ((Shape)this.ellipseVolume).Fill = ((Brush)Application.Current.Resources["PhoneAccentRedBrush"]);
                }
            }));
        }
Example #7
0
        private void Hide(bool hideFreshNews = false)
        {
            this.UpdateSystemTrayAndAppBarIfNeeded();
            this._isAnimating = true;
            IEasingFunction      ieasingFunction = new QuadraticEase();
            object               yproperty       = TranslateTransform.YProperty;
            List <AnimationInfo> animInfoList    = new List <AnimationInfo>()
            {
                new AnimationInfo()
                {
                    target = (DependencyObject)this._translateHeader, propertyPath = yproperty, from = this._translateHeader.Y, to = this._minOffsetHeader, easing = ieasingFunction, duration = 150
                }
            };

            if (hideFreshNews && this._isFreshNewsShowed)
            {
                animInfoList.Add(new AnimationInfo()
                {
                    target       = this._translateFreshNews,
                    propertyPath = yproperty,
                    from         = this._translateFreshNews.Y,
                    to           = this._minOffsetFreshNews,
                    easing       = ieasingFunction,
                    duration     = 150
                });
            }
            AnimationUtil.AnimateSeveral(animInfoList, new int?(0), (Action)(() =>
            {
                this.UpdateExtraCrop();
                this.UpdateSystemTrayAndAppBarIfNeeded();
                this._isAnimating = false;
            }));
        }
Example #8
0
        private void UpdateBackspaceVisibility()
        {
            if (this.Items == null)
            {
                return;
            }
            ISupportBackspaceListItem backspaceListItem = this.Items[this.SelectedIndex] as ISupportBackspaceListItem;
            double num1;
            double num2;

            if (backspaceListItem != null && backspaceListItem.IsBackspaceVisible)
            {
                num1 = 0.0;
                num2 = ((FrameworkElement)this.gridBackspace).Width;
            }
            else
            {
                num1 = ((FrameworkElement)this.gridBackspace).Width;
                num2 = 0.0;
            }
            if (this.translateBackspace.X == num1 && ((FrameworkElement)this.rectBackspacePlaceholder).Width == num2)
            {
                return;
            }
            CubicEase cubicEase = new CubicEase();
            int       num3      = 0;

            ((EasingFunctionBase)cubicEase).EasingMode = ((EasingMode)num3);
            IEasingFunction      ieasingFunction = (IEasingFunction)cubicEase;
            List <AnimationInfo> animInfoList    = new List <AnimationInfo>();

            animInfoList.Add(new AnimationInfo()
            {
                target       = (DependencyObject)this.translateBackspace,
                propertyPath = TranslateTransform.XProperty,
                duration     = 256,
                from         = this.translateBackspace.X,
                to           = num1,
                easing       = ieasingFunction
            });
            animInfoList.Add(new AnimationInfo()
            {
                target       = (DependencyObject)this.rectBackspacePlaceholder,
                propertyPath = FrameworkElement.WidthProperty,
                duration     = 256,
                from         = ((FrameworkElement)this.rectBackspacePlaceholder).Width,
                to           = num2,
                easing       = ieasingFunction
            });
            int?startTime = new int?();

            // ISSUE: variable of the null type

            AnimationUtil.AnimateSeveral(animInfoList, startTime, null);
        }
Example #9
0
        private void MoveToPosition(double x)
        {
            double num1                         = Math.Min(x, 0.0);
            double translateX                   = num1 <= -160.0 ? num1 - (num1 + 160.0) / 2.0 : num1;
            double slideToCancelOpacity         = AudioRecorderUC.GetSlideToCancelOpacity(translateX);
            List <AnimationInfo> animInfoList   = new List <AnimationInfo>();
            AnimationInfo        animationInfo1 = new AnimationInfo();

            animationInfo1.target       = (DependencyObject)this.transformButton;
            animationInfo1.propertyPath = CompositeTransform.TranslateXProperty;
            animationInfo1.from         = this.transformButton.TranslateX;
            animationInfo1.to           = translateX;
            animationInfo1.duration     = 200;
            CubicEase cubicEase1 = new CubicEase();
            int       num2       = 0;

            ((EasingFunctionBase)cubicEase1).EasingMode = ((EasingMode)num2);
            animationInfo1.easing = (IEasingFunction)cubicEase1;
            animInfoList.Add(animationInfo1);
            AnimationInfo animationInfo2 = new AnimationInfo();

            animationInfo2.target       = (DependencyObject)this.translateRecordDuration;
            animationInfo2.propertyPath = TranslateTransform.XProperty;
            animationInfo2.from         = this.translateRecordDuration.X;
            animationInfo2.to           = translateX;
            animationInfo2.duration     = 200;
            CubicEase cubicEase2 = new CubicEase();
            int       num3       = 0;

            ((EasingFunctionBase)cubicEase2).EasingMode = ((EasingMode)num3);
            animationInfo2.easing = (IEasingFunction)cubicEase2;
            animInfoList.Add(animationInfo2);
            AnimationInfo animationInfo3 = new AnimationInfo();

            animationInfo3.target       = (DependencyObject)this.panelSlideToCancel;
            animationInfo3.propertyPath = UIElement.OpacityProperty;
            animationInfo3.from         = ((UIElement)this.panelSlideToCancel).Opacity;
            animationInfo3.to           = slideToCancelOpacity;
            animationInfo3.duration     = 200;
            CubicEase cubicEase3 = new CubicEase();
            int       num4       = 0;

            ((EasingFunctionBase)cubicEase3).EasingMode = ((EasingMode)num4);
            animationInfo3.easing = (IEasingFunction)cubicEase3;
            animInfoList.Add(animationInfo3);
            int?startTime = new int?();

            // ISSUE: variable of the null type

            AnimationUtil.AnimateSeveral(animInfoList, startTime, null);
        }
Example #10
0
 private void AnimateHide(bool up, Action callback)
 {
     if (this._isHidden)
     {
         Action action = callback;
         if (action == null)
         {
             return;
         }
         action();
     }
     else
     {
         this._isAnimating = true;
         List <AnimationInfo> animInfoList = new List <AnimationInfo>();
         animInfoList.Add(new AnimationInfo()
         {
             target       = (DependencyObject)this.translateContent,
             from         = this.translateContent.Y,
             to           = up ? -(this._height + this._contentMarginTop) : this._pageHeight - this._contentMarginTop,
             propertyPath = TranslateTransform.YProperty,
             duration     = 200,
             easing       = TransferCardView.ANIMATION_EASING
         });
         animInfoList.Add(new AnimationInfo()
         {
             target       = (DependencyObject)this.rectBackground,
             from         = ((UIElement)this.rectBackground).Opacity,
             to           = 0.0,
             propertyPath = UIElement.OpacityProperty,
             duration     = 200,
             easing       = TransferCardView.ANIMATION_EASING
         });
         int?   startTime = new int?();
         Action completed = (Action)(() =>
         {
             this._isAnimating = false;
             this._isHidden = true;
             Action action = callback;
             if (action == null)
             {
                 return;
             }
             action();
         });
         AnimationUtil.AnimateSeveral(animInfoList, startTime, completed);
     }
 }
Example #11
0
        private void SetHoveredElement(FrameworkElement newHoveredElement)
        {
            if (this._hoveredElement == newHoveredElement)
            {
                return;
            }
            List <AnimationInfo> animInfoList = new List <AnimationInfo>();

            if (this._hoveredElement != null)
            {
                animInfoList.AddRange((IEnumerable <AnimationInfo>)PreviewBehavior.CreateAnimations(this._hoveredElement, false));
            }
            this._hoveredElement = newHoveredElement;
            if (this._hoveredElement != null)
            {
                animInfoList.AddRange((IEnumerable <AnimationInfo>)PreviewBehavior.CreateAnimations(this._hoveredElement, true));
            }
            AnimationUtil.AnimateSeveral(animInfoList, new int?(0), null);
        }
Example #12
0
        public void Show(bool showFreshNews = false)
        {
            this.UpdateSystemTrayAndAppBarIfNeeded();
            this._isAnimating = true;
            IEasingFunction      easingFunction = (IEasingFunction) new QuadraticEase();
            object               obj            = (object)TranslateTransform.YProperty;
            List <AnimationInfo> animInfoList   = new List <AnimationInfo>()
            {
                new AnimationInfo()
                {
                    target       = (DependencyObject)this._translateHeader,
                    propertyPath = obj,
                    from         = this._translateHeader.Y,
                    to           = this._maxOffsetHeader,
                    easing       = easingFunction,
                    duration     = 150
                }
            };

            if (showFreshNews && this._isFreshNewsShowed)
            {
                animInfoList.Add(new AnimationInfo()
                {
                    target       = (DependencyObject)this._translateFreshNews,
                    propertyPath = obj,
                    from         = this._translateFreshNews.Y,
                    to           = this._ucHeader.Height + 8.0,
                    easing       = easingFunction,
                    duration     = 150
                });
            }
            AnimationUtil.AnimateSeveral(animInfoList, new int?(0), (Action)(() =>
            {
                this.UpdateExtraCrop();
                this.UpdateSystemTrayAndAppBarIfNeeded();
                this._isAnimating = false;
                if (this._isFreshNewsShowed)
                {
                    return;
                }
                this.ShowFreshNews();
            }));
        }
        private void Move(UIElement element1, UIElement element2, bool next, Action completedCallback)
        {
            double num1 = -this.ArrangeWidth;

            if (!next)
            {
                num1 *= -1.0;
            }
            CubicEase cubicEase = new CubicEase();
            int       num2      = 2;

            ((EasingFunctionBase)cubicEase).EasingMode = ((EasingMode)num2);
            IEasingFunction      ieasingFunction  = (IEasingFunction)cubicEase;
            List <AnimationInfo> animInfoList     = new List <AnimationInfo>();
            TranslateTransform   renderTransform1 = element1.RenderTransform as TranslateTransform;
            TranslateTransform   renderTransform2 = element2.RenderTransform as TranslateTransform;

            animInfoList.Add(new AnimationInfo()
            {
                from         = renderTransform1.X,
                to           = renderTransform1.X + num1,
                propertyPath = TranslateTransform.XProperty,
                duration     = 500,
                target       = (DependencyObject)renderTransform1,
                easing       = ieasingFunction
            });
            animInfoList.Add(new AnimationInfo()
            {
                from         = renderTransform2.X,
                to           = renderTransform2.X + num1,
                propertyPath = TranslateTransform.XProperty,
                duration     = 500,
                target       = (DependencyObject)renderTransform2,
                easing       = ieasingFunction
            });
            int?   startTime = new int?(0);
            Action completed = completedCallback;

            AnimationUtil.AnimateSeveral(animInfoList, startTime, completed);
        }
Example #14
0
        private void AnimateElements(IEnumerable indexes, double delta, Action completedCallback, bool moveNextOrPrevious)
        {
            int num = moveNextOrPrevious ? 200 : 175;
            List <AnimationInfo> animInfoList = new List <AnimationInfo>();

            foreach (int index in indexes)
            {
                if (index < this._elements.Count)
                {
                    TranslateTransform elementTransform = this.GetElementTransform(index);
                    animInfoList.Add(new AnimationInfo()
                    {
                        from         = elementTransform.X,
                        to           = elementTransform.X + delta,
                        propertyPath = TranslateTransform.XProperty,
                        duration     = num,
                        target       = (DependencyObject)elementTransform,
                        easing       = SlideView.ANIMATION_EASING
                    });
                }
            }
            AnimationUtil.AnimateSeveral(animInfoList, new int?(0), completedCallback);
        }
Example #15
0
        private void AnimateRecipientInfo()
        {
            CompositeTransform renderTransform1 = ((UIElement)this.gridRecipientAvatar).RenderTransform as CompositeTransform;
            TranslateTransform renderTransform2 = ((UIElement)this.textBlockRecipientName).RenderTransform as TranslateTransform;

            if (renderTransform1 == null || renderTransform2 == null)
            {
                return;
            }
            int    num1;
            double num2;
            double num3;
            double num4;

            switch (this._orientation)
            {
            case DeviceOrientation.LandscapeRight:
                num1 = -90;
                num2 = 240.0 - ((FrameworkElement)this.gridRecipientAvatar).Width / 2.0;
                num3 = 240.0 - ((FrameworkElement)this.textBlockRecipientName).ActualWidth / 2.0;
                num4 = 0.0;
                break;

            case DeviceOrientation.LandscapeLeft:
                num1 = 90;
                num2 = 240.0 - ((FrameworkElement)this.gridRecipientAvatar).Width / 2.0;
                num3 = 240.0 - ((FrameworkElement)this.textBlockRecipientName).ActualWidth / 2.0;
                num4 = 0.0;
                break;

            default:
                num1 = 0;
                num2 = this._recipientAvatarInitialLeft;
                num3 = this._recipientNameInitialLeft;
                num4 = 1.0;
                break;
            }
            CubicEase cubicEase = new CubicEase();
            int       num5      = 0;

            ((EasingFunctionBase)cubicEase).EasingMode = ((EasingMode)num5);
            IEasingFunction      ieasingFunction1 = (IEasingFunction)cubicEase;
            List <AnimationInfo> animInfoList     = new List <AnimationInfo>();
            AnimationInfo        animationInfo1   = new AnimationInfo();

            animationInfo1.target       = (DependencyObject)renderTransform1;
            animationInfo1.propertyPath = CompositeTransform.RotationProperty;
            double rotation = renderTransform1.Rotation;

            animationInfo1.from = rotation;
            double num6 = (double)num1;

            animationInfo1.to = num6;
            int num7 = 200;

            animationInfo1.duration = num7;
            IEasingFunction ieasingFunction2 = ieasingFunction1;

            animationInfo1.easing = ieasingFunction2;
            animInfoList.Add(animationInfo1);
            AnimationInfo animationInfo2 = new AnimationInfo();

            animationInfo2.target       = (DependencyObject)renderTransform1;
            animationInfo2.propertyPath = CompositeTransform.TranslateXProperty;
            double translateX = renderTransform1.TranslateX;

            animationInfo2.from = translateX;
            double num8 = num2;

            animationInfo2.to = num8;
            int num9 = 200;

            animationInfo2.duration = num9;
            IEasingFunction ieasingFunction3 = ieasingFunction1;

            animationInfo2.easing = ieasingFunction3;
            animInfoList.Add(animationInfo2);
            AnimationInfo animationInfo3 = new AnimationInfo();

            animationInfo3.target       = (DependencyObject)renderTransform2;
            animationInfo3.propertyPath = TranslateTransform.XProperty;
            double x = renderTransform2.X;

            animationInfo3.from = x;
            double num10 = num3;

            animationInfo3.to = num10;
            int num11 = 200;

            animationInfo3.duration = num11;
            IEasingFunction ieasingFunction4 = ieasingFunction1;

            animationInfo3.easing = ieasingFunction4;
            animInfoList.Add(animationInfo3);
            animInfoList.Add(new AnimationInfo()
            {
                target       = (DependencyObject)this.textBlockRecipientName,
                propertyPath = UIElement.OpacityProperty,
                from         = ((UIElement)this.textBlockRecipientName).Opacity,
                to           = num4,
                duration     = 200,
                easing       = ieasingFunction1
            });
            int?startTime = new int?();

            // ISSUE: variable of the null type

            AnimationUtil.AnimateSeveral(animInfoList, startTime, null);
        }
Example #16
0
        private void ShowHideThicknessPopup(bool show)
        {
            if (this._isThicknessPopupAnimating)
            {
                return;
            }
            this._isThicknessPopupAnimating = true;
            TranslateTransform translateTransform = (TranslateTransform)this.ucBrushThickness.RenderTransform;
            CubicEase          cubicEase          = new CubicEase();
            int num1 = !show ? 1 : 0;

            cubicEase.EasingMode = (EasingMode)num1;
            IEasingFunction easingFunction1 = (IEasingFunction)cubicEase;
            int             num2            = show ? -8 : 0;
            int             num3            = show ? 1 : 0;

            if (show)
            {
                this.ucBrushThickness.Visibility            = Visibility.Visible;
                this.borderThicknessPopupOverlay.Visibility = Visibility.Visible;
                Touch.FrameReported -= new TouchFrameEventHandler(this.Touch_OnFrameReported);
            }
            else
            {
                this.ucBrushThickness.IsHitTestVisible      = false;
                this.borderThicknessPopupOverlay.Visibility = Visibility.Collapsed;
                Touch.FrameReported += new TouchFrameEventHandler(this.Touch_OnFrameReported);
            }
            List <AnimationInfo> animInfoList  = new List <AnimationInfo>();
            AnimationInfo        animationInfo = new AnimationInfo();

            animationInfo.target       = (DependencyObject)translateTransform;
            animationInfo.propertyPath = (object)TranslateTransform.YProperty;
            double y = translateTransform.Y;

            animationInfo.from = y;
            double num4 = (double)num2;

            animationInfo.to = num4;
            int num5 = 200;

            animationInfo.duration = num5;
            IEasingFunction easingFunction2 = easingFunction1;

            animationInfo.easing = easingFunction2;
            animInfoList.Add(animationInfo);
            animInfoList.Add(new AnimationInfo()
            {
                target       = (DependencyObject)this.ucBrushThickness,
                propertyPath = (object)UIElement.OpacityProperty,
                from         = this.ucBrushThickness.Opacity,
                to           = (double)num3,
                duration     = 200,
                easing       = easingFunction1
            });
            int?   startTime = new int?();
            Action completed = (Action)(() =>
            {
                this._isThicknessPopupAnimating = false;
                if (show)
                {
                    return;
                }
                this.ucBrushThickness.IsHitTestVisible = true;
                this.ucBrushThickness.Visibility = Visibility.Collapsed;
            });

            AnimationUtil.AnimateSeveral(animInfoList, startTime, completed);
        }
Example #17
0
        private void GoToSendState()
        {
            this._isInSendState = true;
            List <AnimationInfo> animInfoList = new List <AnimationInfo>();

            animInfoList.Add(new AnimationInfo()
            {
                target       = (DependencyObject)this.scaleStop,
                propertyPath = ScaleTransform.ScaleXProperty,
                from         = this.scaleStop.ScaleX,
                to           = 0.0,
                duration     = 150
            });
            animInfoList.Add(new AnimationInfo()
            {
                target       = (DependencyObject)this.scaleStop,
                propertyPath = ScaleTransform.ScaleYProperty,
                from         = this.scaleStop.ScaleY,
                to           = 0.0,
                duration     = 150
            });
            animInfoList.Add(new AnimationInfo()
            {
                target       = (DependencyObject)this.borderStop,
                propertyPath = UIElement.OpacityProperty,
                from         = ((UIElement)this.borderStop).Opacity,
                to           = 0.0,
                duration     = 150
            });
            animInfoList.Add(new AnimationInfo()
            {
                target       = (DependencyObject)this.panelSlideToCancel,
                propertyPath = UIElement.OpacityProperty,
                from         = ((UIElement)this.panelSlideToCancel).Opacity,
                to           = 0.0,
                duration     = 150
            });
            List <AnimationInfo> animationsSend = new List <AnimationInfo>()
            {
                new AnimationInfo()
                {
                    target       = (DependencyObject)this.scaleSend,
                    propertyPath = ScaleTransform.ScaleXProperty,
                    from         = this.scaleSend.ScaleX,
                    to           = 1.0,
                    duration     = 150
                },
                new AnimationInfo()
                {
                    target       = (DependencyObject)this.scaleSend,
                    propertyPath = ScaleTransform.ScaleYProperty,
                    from         = this.scaleSend.ScaleY,
                    to           = 1.0,
                    duration     = 150
                },
                new AnimationInfo()
                {
                    target       = (DependencyObject)this.borderSend,
                    propertyPath = UIElement.OpacityProperty,
                    from         = ((UIElement)this.borderSend).Opacity,
                    to           = 1.0,
                    duration     = 150
                },
                new AnimationInfo()
                {
                    target       = (DependencyObject)this.borderCancelButton,
                    propertyPath = UIElement.OpacityProperty,
                    from         = ((UIElement)this.borderCancelButton).Opacity,
                    to           = 1.0,
                    duration     = 150
                }
            };
            int?   startTime = new int?();
            Action completed = (() => AnimationUtil.AnimateSeveral(animationsSend, new int?(), null));

            AnimationUtil.AnimateSeveral(animInfoList, startTime, completed);
        }
Example #18
0
        private void AnimateControls()
        {
            RotateTransform renderTransform1 = ((UIElement)this.borderClose).RenderTransform as RotateTransform;
            RotateTransform renderTransform2 = ((UIElement)this.gridAttach).RenderTransform as RotateTransform;
            RotateTransform renderTransform3 = ((UIElement)this.borderUndo).RenderTransform as RotateTransform;
            RotateTransform renderTransform4 = ((UIElement)this.borderThickness).RenderTransform as RotateTransform;

            if (renderTransform1 == null || renderTransform2 == null || (renderTransform3 == null || renderTransform4 == null))
            {
                return;
            }
            int num1 = 0;

            switch (this._orientation)
            {
            case DeviceOrientation.LandscapeRight:
                num1 = -90;
                break;

            case DeviceOrientation.LandscapeLeft:
                num1 = 90;
                break;
            }
            List <AnimationInfo> animInfoList   = new List <AnimationInfo>();
            AnimationInfo        animationInfo1 = new AnimationInfo();

            animationInfo1.target       = (DependencyObject)renderTransform1;
            animationInfo1.propertyPath = RotateTransform.AngleProperty;
            double angle1 = renderTransform1.Angle;

            animationInfo1.from = angle1;
            double num2 = (double)num1;

            animationInfo1.to = num2;
            int num3 = 200;

            animationInfo1.duration = num3;
            animInfoList.Add(animationInfo1);
            AnimationInfo animationInfo2 = new AnimationInfo();

            animationInfo2.target       = (DependencyObject)renderTransform2;
            animationInfo2.propertyPath = RotateTransform.AngleProperty;
            double angle2 = renderTransform1.Angle;

            animationInfo2.from = angle2;
            double num4 = (double)num1;

            animationInfo2.to = num4;
            int num5 = 200;

            animationInfo2.duration = num5;
            animInfoList.Add(animationInfo2);
            AnimationInfo animationInfo3 = new AnimationInfo();

            animationInfo3.target       = (DependencyObject)renderTransform3;
            animationInfo3.propertyPath = RotateTransform.AngleProperty;
            double angle3 = renderTransform1.Angle;

            animationInfo3.from = angle3;
            double num6 = (double)num1;

            animationInfo3.to = num6;
            int num7 = 200;

            animationInfo3.duration = num7;
            animInfoList.Add(animationInfo3);
            AnimationInfo animationInfo4 = new AnimationInfo();

            animationInfo4.target       = (DependencyObject)renderTransform4;
            animationInfo4.propertyPath = RotateTransform.AngleProperty;
            double angle4 = renderTransform1.Angle;

            animationInfo4.from = angle4;
            double num8 = (double)num1;

            animationInfo4.to = num8;
            int num9 = 200;

            animationInfo4.duration = num9;
            animInfoList.Add(animationInfo4);
            int?startTime = new int?();

            // ISSUE: variable of the null type

            AnimationUtil.AnimateSeveral(animInfoList, startTime, null);
        }
Example #19
0
        private void MoveToInitial()
        {
            if (this._isInInitial)
            {
                return;
            }
            this._isInInitial = true;
            ((Shape)this.ellipseVolume).Fill = ((Brush)Application.Current.Resources["PhoneBlue300_GrayBlue400Brush"]);
            List <AnimationInfo> animInfoList   = new List <AnimationInfo>();
            AnimationInfo        animationInfo1 = new AnimationInfo();

            animationInfo1.target       = (DependencyObject)this.transformButton;
            animationInfo1.propertyPath = CompositeTransform.TranslateXProperty;
            animationInfo1.from         = this.transformButton.TranslateX;
            animationInfo1.to           = 0.0;
            animationInfo1.duration     = 200;
            CubicEase cubicEase1 = new CubicEase();
            int       num1       = 0;

            ((EasingFunctionBase)cubicEase1).EasingMode = ((EasingMode)num1);
            animationInfo1.easing = (IEasingFunction)cubicEase1;
            animInfoList.Add(animationInfo1);
            AnimationInfo animationInfo2 = new AnimationInfo();

            animationInfo2.target       = (DependencyObject)this.translateRecordDuration;
            animationInfo2.propertyPath = TranslateTransform.XProperty;
            animationInfo2.from         = this.translateRecordDuration.X;
            animationInfo2.to           = 0.0;
            animationInfo2.duration     = 200;
            CubicEase cubicEase2 = new CubicEase();
            int       num2       = 0;

            ((EasingFunctionBase)cubicEase2).EasingMode = ((EasingMode)num2);
            animationInfo2.easing = (IEasingFunction)cubicEase2;
            animInfoList.Add(animationInfo2);
            AnimationInfo animationInfo3 = new AnimationInfo();

            animationInfo3.target       = (DependencyObject)this.borderCancel;
            animationInfo3.propertyPath = UIElement.OpacityProperty;
            animationInfo3.from         = ((UIElement)this.borderCancel).Opacity;
            animationInfo3.to           = 0.0;
            CubicEase cubicEase3 = new CubicEase();
            int       num3       = 1;

            ((EasingFunctionBase)cubicEase3).EasingMode = ((EasingMode)num3);
            animationInfo3.easing = (IEasingFunction)cubicEase3;
            int num4 = 200;

            animationInfo3.duration = num4;
            animInfoList.Add(animationInfo3);
            AnimationInfo animationInfo4 = new AnimationInfo();

            animationInfo4.target       = (DependencyObject)this.panelSlideToCancel;
            animationInfo4.propertyPath = UIElement.OpacityProperty;
            animationInfo4.from         = ((UIElement)this.panelSlideToCancel).Opacity;
            animationInfo4.to           = 1.0;
            CubicEase cubicEase4 = new CubicEase();
            int       num5       = 0;

            ((EasingFunctionBase)cubicEase4).EasingMode = ((EasingMode)num5);
            animationInfo4.easing = (IEasingFunction)cubicEase4;
            int num6 = 200;

            animationInfo4.duration = num6;
            animInfoList.Add(animationInfo4);
            int?startTime = new int?();

            // ISSUE: variable of the null type

            AnimationUtil.AnimateSeveral(animInfoList, startTime, null);
        }
Example #20
0
        private void AnimateOverlay(bool show)
        {
            if (show)
            {
                List <AnimationInfo> animInfoList   = new List <AnimationInfo>();
                AnimationInfo        animationInfo1 = new AnimationInfo();
                animationInfo1.target       = (DependencyObject)this.transformButton;
                animationInfo1.propertyPath = CompositeTransform.ScaleXProperty;
                animationInfo1.from         = this.transformButton.ScaleX;
                animationInfo1.to           = 1.0;
                animationInfo1.duration     = 150;
                CubicEase cubicEase1 = new CubicEase();
                int       num1       = 0;
                ((EasingFunctionBase)cubicEase1).EasingMode = ((EasingMode)num1);
                animationInfo1.easing = (IEasingFunction)cubicEase1;
                animInfoList.Add(animationInfo1);
                AnimationInfo animationInfo2 = new AnimationInfo();
                animationInfo2.target       = (DependencyObject)this.transformButton;
                animationInfo2.propertyPath = CompositeTransform.ScaleYProperty;
                animationInfo2.from         = this.transformButton.ScaleY;
                animationInfo2.to           = 1.0;
                animationInfo2.duration     = 150;
                CubicEase cubicEase2 = new CubicEase();
                int       num2       = 0;
                ((EasingFunctionBase)cubicEase2).EasingMode = ((EasingMode)num2);
                animationInfo2.easing = (IEasingFunction)cubicEase2;
                animInfoList.Add(animationInfo2);
                AnimationInfo animationInfo3 = new AnimationInfo();
                animationInfo3.target       = (DependencyObject)this.translateRecordOverlay;
                animationInfo3.propertyPath = TranslateTransform.XProperty;
                animationInfo3.from         = this.translateRecordOverlay.X;
                animationInfo3.to           = 0.0;
                animationInfo3.duration     = 150;
                CubicEase cubicEase3 = new CubicEase();
                int       num3       = 0;
                ((EasingFunctionBase)cubicEase3).EasingMode = ((EasingMode)num3);
                animationInfo3.easing = (IEasingFunction)cubicEase3;
                animInfoList.Add(animationInfo3);
                int?startTime = new int?();
                // ISSUE: variable of the null type

                AnimationUtil.AnimateSeveral(animInfoList, startTime, null);
            }
            else
            {
                List <AnimationInfo> animInfoList   = new List <AnimationInfo>();
                AnimationInfo        animationInfo1 = new AnimationInfo();
                animationInfo1.target       = (DependencyObject)this.transformButton;
                animationInfo1.propertyPath = CompositeTransform.ScaleXProperty;
                animationInfo1.from         = this.transformButton.ScaleX;
                animationInfo1.to           = 0.0;
                animationInfo1.duration     = 150;
                CubicEase cubicEase1 = new CubicEase();
                int       num1       = 0;
                ((EasingFunctionBase)cubicEase1).EasingMode = ((EasingMode)num1);
                animationInfo1.easing = (IEasingFunction)cubicEase1;
                animInfoList.Add(animationInfo1);
                AnimationInfo animationInfo2 = new AnimationInfo();
                animationInfo2.target       = (DependencyObject)this.transformButton;
                animationInfo2.propertyPath = CompositeTransform.ScaleYProperty;
                animationInfo2.from         = this.transformButton.ScaleY;
                animationInfo2.to           = 0.0;
                animationInfo2.duration     = 150;
                CubicEase cubicEase2 = new CubicEase();
                int       num2       = 0;
                ((EasingFunctionBase)cubicEase2).EasingMode = ((EasingMode)num2);
                animationInfo2.easing = (IEasingFunction)cubicEase2;
                animInfoList.Add(animationInfo2);
                AnimationInfo animationInfo3 = new AnimationInfo();
                animationInfo3.target       = (DependencyObject)this.translateRecordOverlay;
                animationInfo3.propertyPath = TranslateTransform.XProperty;
                animationInfo3.from         = this.translateRecordOverlay.X;
                animationInfo3.to           = base.ActualWidth;
                animationInfo3.duration     = 150;
                CubicEase cubicEase3 = new CubicEase();
                int       num3       = 1;
                ((EasingFunctionBase)cubicEase3).EasingMode = ((EasingMode)num3);
                animationInfo3.easing = (IEasingFunction)cubicEase3;
                animInfoList.Add(animationInfo3);
                int?   startTime = new int?();
                Action completed = new Action(this.UpdateVisibilityState);
                AnimationUtil.AnimateSeveral(animInfoList, startTime, completed);
            }
        }
Example #21
0
        public void ShowHideMenu()
        {
            if (this._isAnimating)
            {
                return;
            }
            if (!(((UIElement)this.MenuElement).RenderTransform is TranslateTransform))
            {
                ((UIElement)this.MenuElement).RenderTransform = ((Transform) new TranslateTransform());
            }
            if (((UIElement)this.MenuElement).CacheMode == null)
            {
                ((UIElement)this.MenuElement).CacheMode = ((CacheMode) new BitmapCache());
            }
            TranslateTransform renderTransform = ((UIElement)this.MenuElement).RenderTransform as TranslateTransform;

            if (this._overlay == null)
            {
                this.CreateOverlay();
            }
            if (!this._isMenuShown)
            {
                if (this._isFirstTimeMenuShown && this.InitializeMenuCallback != null)
                {
                    this.InitializeMenuCallback();
                    this._isFirstTimeMenuShown = false;
                }
                if (this.BeforeOpenMenuCallback != null)
                {
                    this.BeforeOpenMenuCallback();
                }
                ((UIElement)this.MenuElement).Visibility = Visibility.Visible;
                ((UIElement)this.MenuElement).UpdateLayout();
                renderTransform.Y = (-this.MenuElement.ActualHeight - ((FrameworkElement)this.Header).ActualHeight);
                this._isAnimating = true;
                List <AnimationInfo> animInfoList   = new List <AnimationInfo>();
                AnimationInfo        animationInfo1 = new AnimationInfo();
                animationInfo1.duration = 250;
                CubicEase cubicEase = new CubicEase();
                int       num1      = 0;
                ((EasingFunctionBase)cubicEase).EasingMode = ((EasingMode)num1);
                animationInfo1.easing = (IEasingFunction)cubicEase;
                double y = renderTransform.Y;
                animationInfo1.from = y;
                double num2 = 0.0;
                animationInfo1.to = num2;
                TranslateTransform translateTransform = renderTransform;
                animationInfo1.target = (DependencyObject)translateTransform;
                // ISSUE: variable of the null type
                animationInfo1.propertyPath = TranslateTransform.YProperty;
                animInfoList.Add(animationInfo1);
                AnimationInfo animationInfo2 = new AnimationInfo();
                animationInfo2.duration = 250;
                animationInfo2.from     = 0.0;
                animationInfo2.to       = 1.0;
                Rectangle overlay = this._overlay;
                animationInfo2.target = (DependencyObject)overlay;
                // ISSUE: variable of the null type
                animationInfo2.propertyPath = UIElement.OpacityProperty;
                animInfoList.Add(animationInfo2);
                int?   startTime = new int?(0);
                Action completed = (Action)(() => this._isAnimating = false);
                AnimationUtil.AnimateSeveral(animInfoList, startTime, completed);
                PageBase currentPage = FramePageUtils.CurrentPage;
                if (currentPage != null)
                {
                    this._savedAppBar          = currentPage.ApplicationBar;
                    currentPage.ApplicationBar = (null);
                    currentPage.BackKeyPress  += (new EventHandler <CancelEventArgs>(this.HideMenuOnBackKeyPress));
                    this._savedSuppressMenu    = currentPage.SuppressMenu;
                    currentPage.SuppressMenu   = true;
                }
                if (this.ContentPanel != null)
                {
                    int num3 = ((PresentationFrameworkCollection <UIElement>)((Panel)this.ContentPanel).Children).IndexOf((UIElement)this.MenuElement);
                    if (num3 >= 0)
                    {
                        ((PresentationFrameworkCollection <UIElement>)((Panel)this.ContentPanel).Children).Insert(num3, (UIElement)this._overlay);
                    }
                    else
                    {
                        ((PresentationFrameworkCollection <UIElement>)((Panel)this.ContentPanel).Children).Add((UIElement)this._overlay);
                    }
                }
            }
            else
            {
                this._isAnimating = true;
                List <AnimationInfo> animInfoList   = new List <AnimationInfo>();
                AnimationInfo        animationInfo1 = new AnimationInfo();
                animationInfo1.duration = 250;
                ExponentialEase exponentialEase = new ExponentialEase();
                int             num1            = 0;
                ((EasingFunctionBase)exponentialEase).EasingMode = ((EasingMode)num1);
                double num2 = 6.0;
                exponentialEase.Exponent = num2;
                animationInfo1.easing    = (IEasingFunction)exponentialEase;
                double num3 = 0.0;
                animationInfo1.from = num3;
                double num4 = -this.MenuElement.ActualHeight - ((FrameworkElement)this.Header).ActualHeight;
                animationInfo1.to = num4;
                TranslateTransform translateTransform = renderTransform;
                animationInfo1.target = (DependencyObject)translateTransform;
                // ISSUE: variable of the null type
                animationInfo1.propertyPath = TranslateTransform.YProperty;
                animInfoList.Add(animationInfo1);
                AnimationInfo animationInfo2 = new AnimationInfo();
                animationInfo2.duration = 250;
                animationInfo2.from     = 0.0;
                animationInfo2.to       = 1.0;
                Rectangle overlay = this._overlay;
                animationInfo2.target = (DependencyObject)overlay;
                // ISSUE: variable of the null type
                animationInfo2.propertyPath = UIElement.OpacityProperty;
                animInfoList.Add(animationInfo2);
                int?   startTime = new int?(0);
                Action completed = (Action)(() =>
                {
                    this._isAnimating = false;
                    ((UIElement)this.MenuElement).Visibility = Visibility.Collapsed;
                    if (this.AfterCloseMenuCallback == null)
                    {
                        return;
                    }
                    this.AfterCloseMenuCallback();
                });
                AnimationUtil.AnimateSeveral(animInfoList, startTime, completed);
                PageBase currentPage = FramePageUtils.CurrentPage;
                if (currentPage != null)
                {
                    currentPage.ApplicationBar = this._savedAppBar;
                    currentPage.BackKeyPress  -= (new EventHandler <CancelEventArgs>(this.HideMenuOnBackKeyPress));
                    currentPage.SuppressMenu   = this._savedSuppressMenu;
                }
                Grid contentPanel = this.ContentPanel;
                if (contentPanel != null)
                {
                    ((PresentationFrameworkCollection <UIElement>)((Panel)contentPanel).Children).Remove((UIElement)this._overlay);
                }
            }
            this._isMenuShown = !this._isMenuShown;
            this.UpdateMenuIcons();
        }