Exemplo n.º 1
0
        private void ConfigureAnimations()
        {
            ElementCompositionPreview.SetIsTranslationEnabled(paraimage, true);
            ElementCompositionPreview.SetImplicitShowAnimation(paraimage, VisualHelpers.CreateVerticalOffsetAnimationFrom(0.55, -150));
            ElementCompositionPreview.SetImplicitHideAnimation(paraimage, VisualHelpers.CreateVerticalOffsetAnimationTo(0.55, -150));
            ElementCompositionPreview.SetImplicitHideAnimation(paraimage, VisualHelpers.CreateOpacityAnimation(0.4, 0));

            Canvas.SetZIndex(this, 1);
            ElementCompositionPreview.SetImplicitHideAnimation(this, VisualHelpers.CreateOpacityAnimation(0.4, 0));
        }
Exemplo n.º 2
0
 private void ConfigureAnimations()
 {
     // TODO: collapse all this into a single helper method
     ElementCompositionPreview.SetIsTranslationEnabled(HostElement, true);
     ElementCompositionPreview.SetImplicitShowAnimation(HostElement,
                                                        VisualHelpers.CreateAnimationGroup(
                                                            VisualHelpers.CreateVerticalOffsetAnimationFrom(0.45, -50f),
                                                            VisualHelpers.CreateOpacityAnimation(0.5)));
     ElementCompositionPreview.SetImplicitHideAnimation(HostElement, VisualHelpers.CreateOpacityAnimation(0.8, 0));
 }
        private void ConfigureAnimations()
        {
            ElementCompositionPreview.SetIsTranslationEnabled(TitleElement, true);
            ElementCompositionPreview.SetImplicitShowAnimation(TitleElement,
                                                               VisualHelpers.CreateAnimationGroup(
                                                                   VisualHelpers.CreateVerticalOffsetAnimationFrom(0.45, -50f),
                                                                   VisualHelpers.CreateOpacityAnimation(0.5)));

            Canvas.SetZIndex(this, 1);
            ElementCompositionPreview.SetImplicitHideAnimation(this, VisualHelpers.CreateOpacityAnimation(0.4, 0));

            var contentShowAnimations    = VisualHelpers.CreateVerticalOffsetAnimation(0.45, 50, 0.2);
            var contentOpacityAnimations = VisualHelpers.CreateOpacityAnimation(.8);

            ElementCompositionPreview.SetIsTranslationEnabled(ContentElement, true);
            ElementCompositionPreview.SetImplicitShowAnimation(
                ContentElement,
                VisualHelpers.CreateAnimationGroup(contentShowAnimations, contentOpacityAnimations));

            ElementCompositionPreview.SetImplicitHideAnimation(ContentElement, VisualHelpers.CreateVerticalOffsetAnimationTo(0.4, 50));
        }
Exemplo n.º 4
0
        private void ConfigureAnimations()
        {
            // TODO: collapse all this into a single helper method
            ElementCompositionPreview.SetIsTranslationEnabled(header, true);
            ElementCompositionPreview.SetImplicitShowAnimation(header,
                                                               VisualHelpers.CreateAnimationGroup(
                                                                   VisualHelpers.CreateVerticalOffsetAnimationFrom(0.45, -50f),
                                                                   VisualHelpers.CreateOpacityAnimation(0.5)
                                                                   ));
            ElementCompositionPreview.SetImplicitHideAnimation(header, VisualHelpers.CreateOpacityAnimation(0.8, 0));

            ElementCompositionPreview.SetIsTranslationEnabled(playbackcontrolsholder, true);
            ElementCompositionPreview.SetImplicitShowAnimation(
                playbackcontrolsholder,
                VisualHelpers.CreateAnimationGroup(VisualHelpers.CreateVerticalOffsetAnimation(0.55, 100, 0),
                                                   VisualHelpers.CreateOpacityAnimation(0.8)));

            ElementCompositionPreview.SetImplicitHideAnimation(playbackcontrolsholder, VisualHelpers.CreateOpacityAnimation(0.8, 0));

            Canvas.SetZIndex(this, 1);
            ElementCompositionPreview.SetImplicitHideAnimation(this, VisualHelpers.CreateOpacityAnimation(0.8, 0));
        }
Exemplo n.º 5
0
        private void ConfigureAnimations()
        {
            // TODO: collapse all this into a single helper method
            ElementCompositionPreview.SetIsTranslationEnabled(TopBorder, true);
            ElementCompositionPreview.SetImplicitShowAnimation(TopBorder, VisualHelpers.CreateVerticalOffsetAnimationFrom(0.45, -450f));
            ElementCompositionPreview.SetImplicitHideAnimation(TopBorder, VisualHelpers.CreateVerticalOffsetAnimationTo(0.45, -30));

            // ListContent:
            var listContentShowAnimations    = VisualHelpers.CreateVerticalOffsetAnimation(0.45, 50, 0.2);
            var listContentOpacityAnimations = VisualHelpers.CreateOpacityAnimation(.8);

            ElementCompositionPreview.SetIsTranslationEnabled(ListContent, true);
            ElementCompositionPreview.SetImplicitShowAnimation(
                ListContent,
                VisualHelpers.CreateAnimationGroup(listContentShowAnimations, listContentOpacityAnimations));

            ElementCompositionPreview.SetImplicitHideAnimation(ListContent, VisualHelpers.CreateVerticalOffsetAnimationTo(0.4, 50));

            // Set Z index to force this page to the top during the hide animation
            Canvas.SetZIndex(this, 1);
            ElementCompositionPreview.SetImplicitHideAnimation(this, VisualHelpers.CreateOpacityAnimation(0.4, 0));
        }
Exemplo n.º 6
0
        private void ContainerItem_Loaded(object sender, RoutedEventArgs e)
        {
            var itemsPanel    = (ItemsStackPanel)feeditems.ItemsPanelRoot;
            var itemContainer = (ListViewItem)sender;

            var itemIndex = feeditems.IndexFromContainer(itemContainer);

            var relativeIndex = itemIndex - itemsPanel.FirstVisibleIndex;

            Grid uc;

            if (itemContainer.ContentTemplateRoot as SwipeControl != null)
            {
                uc = (itemContainer.ContentTemplateRoot as SwipeControl).Content as Grid;
            }
            else
            {
                uc = itemContainer.ContentTemplateRoot as Grid;
            }

            if (itemContainer.Content != ViewModel.PersistedEpisode && itemIndex >= 0 && itemIndex >= itemsPanel.FirstVisibleIndex && itemIndex <= itemsPanel.LastVisibleIndex)
            {
                var itemVisual = ElementCompositionPreview.GetElementVisual(uc);
                ElementCompositionPreview.SetIsTranslationEnabled(uc, true);

                var staggerDelay = TimeSpan.FromMilliseconds(relativeIndex * 100);

                var offsetAnimation = VisualHelpers.CreateHorizontalOffsetAnimation(0.7, 150, staggerDelay.TotalSeconds);
                itemVisual.StartAnimation("Translation.X", offsetAnimation);

                var opacityAnimation = VisualHelpers.CreateOpacityAnimation(0.5);
                opacityAnimation.DelayBehavior = Windows.UI.Composition.AnimationDelayBehavior.SetInitialValueBeforeDelay;
                opacityAnimation.DelayTime     = staggerDelay;
                itemVisual.StartAnimation("Opacity", opacityAnimation);
            }

            itemContainer.Loaded -= this.ContainerItem_Loaded;
        }
Exemplo n.º 7
0
        private void ConfigureAnimations()
        {
            ElementCompositionPreview.SetIsTranslationEnabled(title, true);
            ElementCompositionPreview.SetImplicitShowAnimation(title,
                                                               VisualHelpers.CreateAnimationGroup(
                                                                   VisualHelpers.CreateVerticalOffsetAnimationFrom(0.45, -50f),
                                                                   VisualHelpers.CreateOpacityAnimation(0.5)
                                                                   ));

            // favorites listview
            ElementCompositionPreview.SetIsTranslationEnabled(favoriteListView, true);
            ElementCompositionPreview.SetImplicitShowAnimation(
                favoriteListView,
                VisualHelpers.CreateAnimationGroup(
                    VisualHelpers.CreateVerticalOffsetAnimation(0.55, 50, 0),
                    VisualHelpers.CreateOpacityAnimation(0.5)));

            ElementCompositionPreview.SetImplicitHideAnimation(favoriteListView, VisualHelpers.CreateVerticalOffsetAnimationTo(0.4, 50));
            ElementCompositionPreview.SetImplicitHideAnimation(favoriteListView, VisualHelpers.CreateOpacityAnimation(0.4, 0));

            Canvas.SetZIndex(this, 1);
            ElementCompositionPreview.SetImplicitHideAnimation(this, VisualHelpers.CreateOpacityAnimation(0.4, 0));
        }
 private static void SetImplicitHide(UIElement thisPtr)
 {
     ElementCompositionPreview.SetImplicitHideAnimation(thisPtr, VisualHelpers.CreateOpacityAnimation(0.4, 0));
     Canvas.SetTop(thisPtr, 1);
 }