コード例 #1
0
        public void UpdateCardLayoutAsync(double animationDuration = Double.MaxValue, bool rotate = false)
        {
            if (animationDuration == Double.MaxValue)
            {
                animationDuration = 50;
            }

            if (this.Items.Count == 0)
            {
                return;
            }

            int prevZIndex = Canvas.GetZIndex(this.Items[0]);

            for (int i = 0; i < this.Items.Count; i++)
            {
                CardView         card = this.Items[i];
                GeneralTransform gt   = this.TransformToVisual(card);
                Point            ptTo = gt.TransformPoint(this.GetCardTopLeft(i));
                card.AnimationPosition = ptTo;
                card.AnimateToAsync(ptTo, rotate, animationDuration);
                if (_layout == CardLayout.PlayedOverlapped)
                {
                    Canvas.SetZIndex(card, prevZIndex++);
                }
            }
        }
コード例 #2
0
        public void MoveCardToTargetAsync(CardView card, CardContainer target, double animationDuration = Double.MaxValue, bool rotate = false, bool transferCard = true)
        {
            if (animationDuration == Double.MaxValue)
            {
                animationDuration = MainPage.AnimationSpeeds.Medium;
            }
            Point ptTo = SetupCardForMove(card, target, rotate, transferCard);

            card.AnimateToAsync(ptTo, rotate, animationDuration);
            if (transferCard)
            {
                this.UpdateCardLayoutAsync();
            }
        }