Esempio n. 1
0
        /// <summary>
        /// Create closing animations for modal background and popup
        /// </summary>
        private Animation CreateClosingAnimation()
        {
            Animation animationGroup = new Animation();

            if (ClosingAnimation != null)
            {
                if (ClosingAnimation is IAnimation popupAnimation)
                {
                    animationGroup.Add(0, 1, popupAnimation.Create(_popupRootLayout));
                }
                else
                {
                    animationGroup.Add(0, 1, ClosingAnimation.Create(_popupRootLayout));
                }

                Animation modalAnim = PopupLayout.CreateModalBackgroundAnimation(false);
                if (ClosingAnimation.Duration > 0 && modalAnim != null && HasModalBackground)
                {
                    animationGroup.Add(0, 1, modalAnim);
                }
            }

            if (animationGroup.HasSubAnimations())
            {
                return(animationGroup);
            }
            else
            {
                return(null);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Create opening animations for modal background and popup
        /// </summary>
        private Animation CreateOpeningAnimation()
        {
            Animation animationGroup = new Animation();

            if (OpeningAnimation != null)
            {
                if (OpeningAnimation is IAnimation popupAnimation)
                {
                    animationGroup.Add(0, 1, popupAnimation.Create(_popupRootLayout));
                }
                else
                {
                    animationGroup.Add(0, 1, OpeningAnimation.Create(_popupRootLayout));
                }

                Animation backgroundAnimation = PopupLayout.CreateModalBackgroundAnimation(true);
                if (backgroundAnimation != null && HasModalBackground)
                {
                    animationGroup.Add(0, 1, backgroundAnimation);
                }
            }

            if (animationGroup.HasSubAnimations())
            {
                return(animationGroup);
            }
            else
            {
                return(null);
            }
        }