private void AnimateItemSize(TileViewItem item, Size targetSize)
 {
     if (!item.SizeAnimating)
     {
         var size = new Size(item.ActualWidth, item.ActualHeight);
         item.Height = targetSize.Height;
         item.Width  = targetSize.Width;
         double totalSeconds = ResizingDuration.TimeSpan.TotalSeconds;
         var    args         = new double[4];
         args[1] = size.Height;
         args[2] = totalSeconds;
         args[3] = targetSize.Height;
         var numArray2 = new double[4];
         numArray2[1] = size.Width;
         numArray2[2] = totalSeconds;
         numArray2[3] = targetSize.Width;
         Storyboard sb =
             AnimationExtensions.Create().Animate(new FrameworkElement[] { item }).EnsureDefaultTransforms().Height
                 (args).Width(numArray2).EaseAll((ResizingEasing ?? Easings.SlideDown1)).AdjustSpeed().Instance;
         sb.Completed += (sender, e) =>
         {
             sb.Stop();
             item.SizeAnimating = false;
         };
         item.SizeAnimating = true;
         sb.Begin();
     }
 }
        private void AnimateItemPosition(TileViewItem item, Point targetPosition)
        {
            if (item.PositionAnimating)
            {
                return;
            }
            Point  currentItemPosition = GetCurrentItemPosition(item);
            double num  = targetPosition.X - currentItemPosition.X;
            double num2 = targetPosition.Y - currentItemPosition.Y;

            if (Equals(MaximizedItem, item))
            {
                int currentZIndex = TileViewItem.CurrentZIndex;
                TileViewItem.CurrentZIndex = currentZIndex + 1;
                Canvas.SetZIndex(item, currentZIndex);
            }
            double totalSeconds = ReorderingDuration.TimeSpan.TotalSeconds;
            var    args         = new double[4];

            args[1] = -num;
            args[2] = totalSeconds;
            var numArray2 = new double[4];

            numArray2[1] = -num2;
            numArray2[2] = totalSeconds;
            Storyboard sb =
                AnimationExtensions.Create().Animate(new FrameworkElement[] { item }).EnsureDefaultTransforms().MoveX(
                    args).MoveY(numArray2).Origin(0.0, 0.0).EaseAll((ReorderingEasing ?? Easings.SlideDown1)).
                AdjustSpeed().Instance;

            sb.Completed += (sender, e) =>
            {
                sb.Stop();
                item.PositionAnimating = false;
            };
            SetItemPosition(item, targetPosition);
            item.PositionAnimating = true;
            sb.Begin();
        }