Ejemplo n.º 1
0
        private void ToggleDetailControlAnimation()
        {
            var currentPos    = _clickedContainer.TransformToVisual(ListControl).TransformPoint(new Point(0, 0));
            var targetPos     = GetTargetPosition();
            var targetRatio   = GetTargetSize().X / _clickedContainer.ActualWidth;
            var targetOffsetX = targetPos.X - currentPos.X;
            var targetOffsetY = targetPos.Y - currentPos.Y;

            if (_titleStackVisual.Offset.Y == 0)
            {
                _restoreTitleStackStatus = true;
            }
            ToggleTitleStackAnimation(false);
            ToggleRefreshBtnAnimation(false);

            ListControl.MoveItemAnimation(new Vector3((float)targetOffsetX, (float)targetOffsetY, 0f), (float)targetRatio);
            DetailControl.CurrentImage = _clickedImg;
            DetailControl.ToggleDetailGridAnimation(true);

            NavigationService.AddOperation(() =>
            {
                DetailControl.HideDetailControl();
                return(true);
            });
        }
Ejemplo n.º 2
0
        private void ToggleDetailControlAnimation()
        {
            DetailControl.CurrentImage = _clickedImg;

            var currentPos    = _clickedContainer.TransformToVisual(ListControl).TransformPoint(new Point(0, 0));
            var targetPos     = GetTargetPosition();
            var targetRatio   = GetTargetSize().X / _clickedContainer.ActualWidth;
            var targetOffsetX = targetPos.X - currentPos.X;
            var targetOffsetY = targetPos.Y - currentPos.Y;

            ListControl.MoveItemAnimation(new Vector3((float)targetOffsetX, (float)targetOffsetY, 0f), (float)targetRatio);
            DetailControl.ToggleDetailGridAnimation(true);

            NavigationService.HistoryOperationsBeyondFrame.Push(() =>
            {
                var content = Frame.Content;
                if (content.GetType() == typeof(MainPage))
                {
                    DetailControl.HideDetailControl();
                    return(true);
                }
                else
                {
                    return(false);
                }
            });
        }
Ejemplo n.º 3
0
        private void ToggleDetailControlAnimation()
        {
            var currentPos    = _clickedContainer.TransformToVisual(ListControl).TransformPoint(new Point(0, 0));
            var targetPos     = GetTargetPosition();
            var targetRatio   = GetTargetSize().X / _clickedContainer.ActualWidth;
            var targetOffsetX = targetPos.X - currentPos.X;
            var targetOffsetY = targetPos.Y - currentPos.Y;

            if (targetPos.Y <= TITLE_GRID_HEIGHT)
            {
                if (ListControl.GetScrollViewer().VerticalOffset > 70 && !_hideTitleBarForDetail)
                {
                    _hideTitleBarForDetail = true;
                    ToggleTitleBarAnimation(false);
                }
                else
                {
                    Canvas.SetZIndex(TitleGrid, 1);
                    Canvas.SetZIndex(LoadingGrid, 0);
                    Canvas.SetZIndex(ContentGrid, 2);
                    Canvas.SetZIndex(DetailControl, 3);
                }
            }

            ListControl.MoveItemAnimation(new Vector3((float)targetOffsetX, (float)targetOffsetY, 0f), (float)targetRatio);
            DetailControl.CurrentImage = _clickedImg;
            DetailControl.ToggleDetailGridAnimation(true);

            NavigationService.HistoryOperationsBeyondFrame.Push(() =>
            {
                var content = Frame.Content;
                if (content.GetType() == typeof(MainPage))
                {
                    DetailControl.HideDetailControl();
                    return(true);
                }
                else
                {
                    return(false);
                }
            });
        }