private async Task ToggleListItemAnimationAsync(bool show)
        {
            _listItemVisual.Opacity = 0f;

            var targetImageSize     = GetTargetImageSize();
            var targetImagePosition = GetTargetPosition();

            this.Visibility = Visibility.Visible;

            if (show && !_detailContentGirdSizeSpecified)
            {
                UpdateDetailContentGridSize();
                await DetailContentGrid.WaitForSizeChangedAsync();
            }

            var listItemSize           = new Vector2((float)_listItem.ActualWidth, (float)_listItem.ActualHeight);
            var listItemCenterPosition = _listItem.TransformToVisual(Window.Current.Content)
                                         .TransformPoint(new Point(_listItem.ActualWidth / 2, _listItem.ActualHeight / 2));
            var targetSize = GetTargetImageSize();

            var offsetXAbs = (float)listItemCenterPosition.X - (targetImagePosition.X + targetImageSize.X / 2);
            var offsetYAbs = (float)listItemCenterPosition.Y - (targetImagePosition.Y + targetImageSize.Y / 2);

            var startX = show ? offsetXAbs : _detailContentGridVisual.GetTranslation().X;
            var startY = show ? offsetYAbs : _detailContentGridVisual.GetTranslation().Y;

            var endX = show ? 0f : offsetXAbs;
            var endY = show ? 0f : offsetYAbs;

            var startScale = show ? listItemSize.X / targetImageSize.X : 1f;
            var endScale   = show ? 1f : listItemSize.X / targetImageSize.X;

            _detailGridVisual.Opacity            = 1f;
            _detailContentGridVisual.CenterPoint = new Vector3(targetImageSize.X / 2f, targetImageSize.Y / 2f, 1f);

            var scaleAnim = _compositor.CreateVector3KeyFrameAnimation();

            scaleAnim.Duration = TimeSpan.FromMilliseconds(400);
            scaleAnim.InsertKeyFrame(0f, new Vector3(startScale, startScale, 1f));
            scaleAnim.InsertKeyFrame(1f, new Vector3(endScale, endScale, 1f));
            _detailContentGridVisual.StartAnimation("Scale", scaleAnim);

            var offsetAnim = _compositor.CreateVector3KeyFrameAnimation();

            offsetAnim.Duration = TimeSpan.FromMilliseconds(400);
            offsetAnim.InsertKeyFrame(0f, new Vector3(startX, startY, 0f));
            offsetAnim.InsertKeyFrame(1f, new Vector3(endX, endY, 0f));
            _detailContentGridVisual.StartAnimation("Translation", offsetAnim);
        }
        private async Task UpdateDetailContentGridSizeAsync(bool awaitForSizeChanged)
        {
            var size = GetTargetSize();

            DetailContentGrid.Width  = size.X;
            DetailContentGrid.Height = size.Y;

            DetailContentGrid.Clip = new RectangleGeometry()
            {
                Rect = new Rect(0, 0, size.X, size.Y)
            };

            _detailContentGirdSizeSpecified = true;

            if (awaitForSizeChanged)
            {
                await DetailContentGrid.WaitForSizeChangedAsync();
            }
        }