Ejemplo n.º 1
0
        internal async void HidePopover()
        {
            // fade out the elements
            await Task.WhenAll(
                new Task[]
            {
                FakeExerciseCell.FadeTo(0),
                PagePopover.FadeTo(0)
            });


            // hide our fake product cell
            FakeExerciseCell.IsVisible = false;

            // hide out Page poper
            PagePopover.IsVisible = false;
        }
Ejemplo n.º 2
0
        private async void TapGestureRecognizer_Tapped(object sender, EventArgs e)
        {
            // the user has tapped on an element
            ExerciseDisplay element = sender as ExerciseDisplay;

            // set the binding context to the select cell
            FakeExerciseCell.BindingContext = element.BindingContext;
            FakeExerciseCell.ImageOffsetX   = element.ImageOffsetX;
            FakeExerciseCell.ImageOffsetY   = element.ImageOffsetY;
            FakeExerciseCell.Opacity        = 1;
            FakeExerciseCell.IsVisible      = true;

            // set the selected item
            ((MainViewModel)this.BindingContext).SelectedExercise = element.BindingContext as ExerciseViewModel;


            // set the layout to the same position
            var       yScroll = ScrollContainer.ScrollY;
            Rectangle rect    = new Rectangle(
                x: ScrollContainer.X + element.X,
                y: ScrollContainer.Y + element.Y - yScroll,
                width: element.Width,
                height: element.Height);

            AbsoluteLayout.SetLayoutBounds(FakeExerciseCell, rect);

            // hide the cell we clicked on
            element.Opacity = 0.01;
            await FakeExerciseCell.ExpandToFill(this.Bounds);

            element.Opacity = 1;

            // display the page popover
            PagePopover.Opacity   = 0;
            PagePopover.IsVisible = true;
            await PagePopover.Expand();
        }