Пример #1
0
        public void ConfigureInteractionTracker()
        {
            var backgroundVisual = ElementCompositionPreview.GetElementVisual(MainGrid);

            backgroundVisual.Size = new Vector2((float)MainGrid.ActualWidth, (float)MainGrid.ActualHeight);

            // Configure interaction tracker
            _tracker             = InteractionTracker.CreateWithOwner(_compositor, this);
            _tracker.MaxPosition = new Vector3((float)backgroundVisual.Size.X * _scenarios.Count, backgroundVisual.Size.Y, 0);
            _tracker.MinPosition = new Vector3();

            // Configure interaction source
            _interactionSource = VisualInteractionSource.Create(backgroundVisual);
            _interactionSource.PositionXSourceMode = InteractionSourceMode.EnabledWithInertia;
            _tracker.InteractionSources.Add(_interactionSource);

            // Bind interaction tracker output to animation for now
            var positionExpression = -_tracker.GetReference().Position.X;

            _mainContainer.StartAnimation("Offset.X", positionExpression);

            ConfigureRestingPoints();

            var nestedVisuals = _nestedScenario.GetVisuals();
            var exp           = _compositor.CreateExpressionAnimation();

            for (int i = 0; i < nestedVisuals.Count; i++)
            {
                ConfigureParallax(i, nestedVisuals[i]);
            }
        }
Пример #2
0
        public MainPage()
        {
            InitializeComponent();

            _compositor = Window.Current.Compositor;
            _tracker    = InteractionTracker.CreateWithOwner(_compositor, this);
            _progress   = _compositor.CreatePropertySet();

            RenderAdaptiveCard();

            RomeShare.SessionListUpdated += OnSessionListUpdated;
            Loaded += async(s, e) => await RomeShare.DiscoverSessionsAsync();

            // When the size of the app changes, we need to update all the measures.
            SizeChanged += (s, e) =>
            {
                if (_hitTestVisual != null)
                {
                    _hitTestVisual.Size = Card.RenderSize.ToVector2();

                    var distanceFromTop = (float)Card.RelativePosition(this).Y;
                    _maxDistance         = distanceFromTop + _hitTestVisual.Size.Y;
                    _tracker.MaxPosition = new Vector3(_maxDistance);

                    var trackerNode = _tracker.GetReference();
                    _progress.StartAnimation("Progress", trackerNode.Position.Y / _tracker.MaxPosition.Y);
                }
            };
        }
Пример #3
0
        private void InitializeComposition()
        {
            _containerVisual = ElementCompositionPreview.GetElementVisual(pnlRoot);
            _compositor      = _containerVisual.Compositor;

            _tracker = InteractionTracker.CreateWithOwner(_compositor, this);

            //_cubicBezierEasingFunction = _compositor.CreateCubicBezierEasingFunction(new Vector2(0.8f, 1.0f), new Vector2(0.0f, 1.0f));
            _cubicBezierEasingFunction = _compositor.CreateCubicBezierEasingFunction(new Vector2(.17f, .67f), new Vector2(1f, 1f));

            _containerVisual.Size = new Vector2((float)pnlRoot.ActualWidth, (float)pnlRoot.ActualHeight);
            _props = _compositor.CreatePropertySet();

            VisualInteractionSource interactionSource = VisualInteractionSource.Create(_containerVisual);

            interactionSource.PositionXSourceMode = InteractionSourceMode.EnabledWithInertia;
            _tracker.InteractionSources.Add(interactionSource);

            pnlRoot.PointerPressed += (s, a) =>
            {
                // Capture the touch manipulation to the InteractionTracker for automatic handling
                if (a.Pointer.PointerDeviceType == Windows.Devices.Input.PointerDeviceType.Touch)
                {
                    try
                    {
                        interactionSource.TryRedirectForManipulation(a.GetCurrentPoint(s as UIElement));
                    }
                    catch (UnauthorizedAccessException)
                    {
                        // Ignoring the failed redirect to prevent app crashing
                    }
                }
            };
        }
Пример #4
0
        public void ConfigureInteraction()
        {
            this.interactionSource = VisualInteractionSource.Create(myDrawingVisual);
            this.interactionSource.PositionXSourceMode = InteractionSourceMode.EnabledWithInertia;
            this.interactionSource.PositionYSourceMode = InteractionSourceMode.EnabledWithInertia;

            this.interactionSource.ScaleSourceMode = InteractionSourceMode.EnabledWithInertia;

            this.tracker = InteractionTracker.CreateWithOwner(this.compositor, this);
            this.tracker.InteractionSources.Add(this.interactionSource);

            this.moveSurfaceExpressionAnimation = this.compositor.CreateExpressionAnimation("-tracker.Position.X");
            this.moveSurfaceExpressionAnimation.SetReferenceParameter("tracker", this.tracker);

            this.moveSurfaceUpDownExpressionAnimation = this.compositor.CreateExpressionAnimation("-tracker.Position.Y");
            this.moveSurfaceUpDownExpressionAnimation.SetReferenceParameter("tracker", this.tracker);

            this.scaleSurfaceUpDownExpressionAnimation = this.compositor.CreateExpressionAnimation("tracker.Scale");
            this.scaleSurfaceUpDownExpressionAnimation.SetReferenceParameter("tracker", this.tracker);

            this.tracker.MinPosition = new System.Numerics.Vector3(0, 0, 0);
            //TODO: use same consts as tilemanager object
            this.tracker.MaxPosition = new System.Numerics.Vector3(TILESIZE * 10000, TILESIZE * 10000, 0);

            this.tracker.MinScale = 0.01f;
            this.tracker.MaxScale = 100.0f;
        }
Пример #5
0
        public IRefreshInfoProvider Adapt(Image image, Size visualizerSize)
        {
            this.image = image;
            UIElement parent = (UIElement)VisualTreeHelper.GetParent(image);

            Visual     parentVisual = ElementCompositionPreview.GetElementVisual(parent);
            Compositor compositor   = parentVisual.Compositor;

            infoProvider = new RefreshInfoProviderImplementation(refreshPullDirection, visualizerSize, compositor);

            interactionTracker             = InteractionTracker.CreateWithOwner(compositor, infoProvider);
            interactionTracker.MaxPosition = new Vector3(0.0f);
            interactionTracker.MinPosition = new Vector3(0.0f);
            interactionTracker.MaxScale    = 1.0f;
            interactionTracker.MinScale    = 1.0f;

            visualInteractionSource = VisualInteractionSource.Create(parentVisual);
            visualInteractionSource.ManipulationRedirectionMode = VisualInteractionSourceRedirectionMode.CapableTouchpadOnly;
            visualInteractionSource.ScaleSourceMode             = InteractionSourceMode.Disabled;
            visualInteractionSource.PositionXSourceMode         = IsOrientationVertical() ? InteractionSourceMode.Disabled : InteractionSourceMode.EnabledWithInertia;
            visualInteractionSource.PositionXChainingMode       = IsOrientationVertical() ? InteractionChainingMode.Auto : InteractionChainingMode.Never;
            visualInteractionSource.PositionYSourceMode         = IsOrientationVertical() ? InteractionSourceMode.EnabledWithInertia : InteractionSourceMode.Disabled;
            visualInteractionSource.PositionYChainingMode       = IsOrientationVertical() ? InteractionChainingMode.Never : InteractionChainingMode.Auto;

            interactionTracker.InteractionSources.Add(visualInteractionSource);

            this.image.PointerPressed     += OnImagePointerPressed;
            infoProvider.RefreshStarted   += InfoProvider_RefreshStarted;
            infoProvider.RefreshCompleted += InfoProvider_RefreshCompleted;

            return(infoProvider);
        }
Пример #6
0
        private InteractionTracker InitializeTracker()
        {
            var tracker = InteractionTracker.CreateWithOwner(_compositor, this);

            tracker.MaxPosition = new Vector3(0, (float)navBarPanel.ActualHeight, 0);
            tracker.MinPosition = new Vector3(0, 0, 0);
            tracker.PositionInertiaDecayRate = new Vector3(0.9f, 0.9f, 0.9f);
            tracker.InteractionSources.Add(_scrollInteractionSource);
            return(tracker);
        }
Пример #7
0
        public void Attach(DependencyObject associatedObject)
        {
            AssociatedObject = associatedObject;
            _hittestVisual   = ElementCompositionPreview.GetElementVisual(HittestContent);

            if (_compositor == null)
            {
                _compositor = _hittestVisual.Compositor;
            }
            _tracker    = InteractionTracker.CreateWithOwner(_compositor, this);
            _isExpanded = false;
        }
Пример #8
0
        private void OnLoading(FrameworkElement sender, object args)
        {
            m_interactionTracker = InteractionTracker.CreateWithOwner(m_compositor, this);
            m_sourcesWorkaround  = m_interactionTracker.InteractionSources;
            m_sourcesWorkaround.Add(m_interactionSource);
            m_interactionTracker.Properties.InsertScalar(nameof(CompletedOffset), (float)m_completedOffset);
            m_interactionTracker.Properties.InsertScalar(nameof(CompletionThreshold), (float)m_completionThreshold);
            m_interactionTracker.Properties.InsertVector2("Size", Vector2.Zero);
            m_interactionTracker.ConfigurePositionXInertiaModifiers(m_inertiaModifiers);

            this.SizeChanged += OnSizeChanged;
            OnSizeChanged(this, null);
        }
Пример #9
0
        private void ConfigureInteractionTracker()
        {
            //
            // We're creating two interaction trackers, one nested in the other.  This allows us the user to use
            // pinch/stretch to affect z-position, and not have it change the x-position.  The two work independently.
            //

            _interactionSource1 = VisualInteractionSource.Create(_rootContainer);
            _interactionSource1.ScaleSourceMode = InteractionSourceMode.EnabledWithoutInertia;

            _scaleTracker          = InteractionTracker.CreateWithOwner(_compositor, this);
            _scaleTracker.MinScale = 0.6f;
            _scaleTracker.MaxScale = 5.0f;
            _scaleTracker.ScaleInertiaDecayRate = 0.96f;

            _scaleTracker.InteractionSources.Add(_interactionSource1);

            _interactionSource2 = VisualInteractionSource.Create(_rootContainer2);
            _interactionSource2.PositionXSourceMode = InteractionSourceMode.EnabledWithInertia;

            _positionTracker             = InteractionTracker.CreateWithOwner(_compositor, this);
            _positionTracker.MaxPosition = new Vector3((float)Root.ActualWidth * 1.5f, 0, 0);
            _positionTracker.MinPosition = _positionTracker.MaxPosition * -1;

            _positionTracker.InteractionSources.Add(_interactionSource2);

            //
            // Here's the trick: we take the scale output from the outer (scale) Tracker, and convert
            // it into a value that represents Z.  Then we bind it to the world container's Z position.
            //

            var scaleExpression = _compositor.CreateExpressionAnimation("lerp(0, 1000, (1 - tracker.Scale) / (1 - tracker.MaxScale))");

            scaleExpression.SetReferenceParameter("tracker", _scaleTracker);
            _worldContainer.StartAnimation("Offset.Z", scaleExpression);

            //
            // Bind the output of the inner (xy position) tracker to the world container's XY position.
            //

            var positionExpression = _compositor.CreateExpressionAnimation("-tracker.Position.XY");

            positionExpression.SetReferenceParameter("tracker", _positionTracker);
            _worldContainer.StartAnimation("Offset.XY", positionExpression);
        }
Пример #10
0
        private void SetupModal()
        {
            // Fix display orientation
            DisplayInformation.AutoRotationPreferences = DisplayInformation.GetForCurrentView().CurrentOrientation;

            // Set up visual interaction source
            _root                   = ElementCompositionPreview.GetElementVisual(ITRoot);
            _compositor             = _root.Compositor;
            _is                     = VisualInteractionSource.Create(_root);
            _is.PositionYSourceMode = InteractionSourceMode.EnabledWithInertia;

            // Set up interaction tracker owner
            _itowner = new InteractionTrackerOwner();
            _itowner.StateOrValuesChanged += (r, s) => {
                DebugText1.Text = $"State: {s.Item1}\nPos:   {s.Item2.Y}";
                ChangeScroll(s);
                oldPosition = s.Item2;
            };

            // Set up interaction tracker
            _tracker = InteractionTracker.CreateWithOwner(_compositor, _itowner);
            _tracker.InteractionSources.Add(_is);

            UpdateInteractionTrackerValues();

            var exp = _compositor.CreateExpressionAnimation("-tracker.Position");

            exp.SetReferenceParameter("tracker", _tracker);

            var bv = ElementCompositionPreview.GetElementVisual(ModalContent);

            bv.StartAnimation("Offset", exp);

            ExpressionAnimation _titleAnimation = _compositor.CreateExpressionAnimation("Clamp(tracker.Position.Y, 0, tracker.MaxPosition.Y)");

            _titleAnimation.SetReferenceParameter("tracker", _tracker);

            var tv = ElementCompositionPreview.GetElementVisual(TitleBar);

            tv.StartAnimation("Offset.Y", _titleAnimation);
        }
Пример #11
0
        private void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            _rootVisual      = Root.Visual();
            _rootVisual.Size = new Vector2((float)Root.ActualWidth, (float)Root.ActualHeight);

            _pathContainerVisual      = PathContainer.Visual();
            _pathContainerVisual.Size = _rootVisual.Size;

            _compositor = _rootVisual.Compositor;

            //CreateMoreShapes();

            _interactionSource = VisualInteractionSource.Create(_rootVisual);
            _interactionSource.PositionXSourceMode         = InteractionSourceMode.EnabledWithInertia;
            _interactionSource.PositionYSourceMode         = InteractionSourceMode.EnabledWithInertia;
            _interactionSource.IsPositionXRailsEnabled     = false;
            _interactionSource.IsPositionYRailsEnabled     = false;
            _interactionSource.ScaleSourceMode             = InteractionSourceMode.EnabledWithInertia;
            _interactionSource.ManipulationRedirectionMode = VisualInteractionSourceRedirectionMode.CapableTouchpadOnly;

            _tracker = InteractionTracker.CreateWithOwner(_compositor, this);
            _tracker.InteractionSources.Add(_interactionSource);
            _tracker.MaxPosition           = new Vector3(_rootVisual.Size, 0.0f) * 3.0f;
            _tracker.MinPosition           = _tracker.MaxPosition * -1.0f;
            _tracker.MinScale              = 0.9f;
            _tracker.MaxScale              = 12.0f;
            _tracker.ScaleInertiaDecayRate = 0.96f;

            var positionAnimation = _compositor.CreateExpressionAnimation("-t.Position");

            positionAnimation.SetReferenceParameter("t", _tracker);
            _pathContainerVisual.StartAnimation("Offset", positionAnimation);

            var scaleAnimation = _compositor.CreateExpressionAnimation("Vector2(t.Scale, t.Scale)");

            scaleAnimation.SetReferenceParameter("t", _tracker);
            _pathContainerVisual.StartAnimation("Scale.XY", scaleAnimation);
        }
Пример #12
0
        private void SetupTracker()
        {
            m_tracker = InteractionTracker.CreateWithOwner(compositor, this);
            InitTrackerPositions();

            m_source = VisualInteractionSource.Create(ReaderViewVisual);
            m_source.ManipulationRedirectionMode = VisualInteractionSourceRedirectionMode.CapableTouchpadOnly;

            m_source.IsPositionXRailsEnabled = false;
            m_source.PositionXChainingMode   = InteractionChainingMode.Never;
            m_source.PositionXSourceMode     = InteractionSourceMode.EnabledWithoutInertia;

            m_source.IsPositionYRailsEnabled = false;
            m_source.PositionYChainingMode   = InteractionChainingMode.Never;
            m_source.PositionYSourceMode     = InteractionSourceMode.Disabled;

            m_tracker.InteractionSources.Add(m_source);

            OffsetBind = compositor.CreateExpressionAnimation("-tracker.Position");
            OffsetBind.SetReferenceParameter("tracker", m_tracker);

            PanelVisual.StartAnimation("Offset", OffsetBind);
        }
Пример #13
0
        private void ConfigureInteractionTracker()
        {
            _interactionSource = VisualInteractionSource.Create(_hitTest);

            //Configure for y-direction panning
            _interactionSource.ManipulationRedirectionMode = VisualInteractionSourceRedirectionMode.CapableTouchpadOnly;
            _interactionSource.PositionXSourceMode         = InteractionSourceMode.EnabledWithInertia;
            _interactionSource.PositionXChainingMode       = InteractionChainingMode.Never;
            _interactionSource.IsPositionXRailsEnabled     = true;

            //Create tracker and associate interaction source
            _tracker = InteractionTracker.CreateWithOwner(_visual.Compositor, this);
            _tracker.InteractionSources.Add(_interactionSource);

            _tracker.MaxPosition = new Vector3(_reply ? 72 : 0);
            _tracker.MinPosition = new Vector3(_forward ? -72 : 0);

            _tracker.Properties.InsertBoolean("CanReply", _reply);
            _tracker.Properties.InsertBoolean("CanForward", _forward);

            //ConfigureAnimations(_visual, null);
            ConfigureRestingPoints();
        }
Пример #14
0
        private void InitializeComposition()
        {
            this.compositor  = ElementCompositionPreview.GetElementVisual(this).Compositor;
            this.thumbVisual = ElementCompositionPreview.GetElementVisual(thumb);
            this.trackVisual = ElementCompositionPreview.GetElementVisual(trackCanvas);

            propSet = this.compositor.CreatePropertySet();
            trackCanvas.PointerWheelChanged += new PointerEventHandler(PointerWheel_Changed);
            trackCanvas.PointerMoved        += new PointerEventHandler(MousePointer_Moved);
            trackCanvas.PointerReleased     += new PointerEventHandler(MousePointer_Released);

            // These pointer events are needed if want to click-to-seek. Weird eventing issues between when these get called and when need to call OnDragStart() and OnDragStop() methods
            // trackCanvas.PointerPressed += new PointerEventHandler(MousePointer_Pressed);
            // thumb.PointerPressed += new PointerEventHandler(MousePointer_ThumbPressed);
            this.interactionSource = VisualInteractionSource.Create(this.trackVisual);
            this.interactionSource.PositionXSourceMode = InteractionSourceMode.EnabledWithInertia;
            this.tracker = InteractionTracker.CreateWithOwner(this.compositor, this);
            this.tracker.InteractionSources.Add(this.interactionSource);

            // This is the Expression that we will use to drive the position of the Thumb Scrubber
            // Idea is that we will then update the position of InteractionTracker to move thes scrubber around - this is done via the Pointer Events tied to the TrackCanvas object
            // Note: this is using ExpressionBuilder
            this.thumbExpressionAnimation = -tracker.GetReference().Position.X;
        }
        private void ConfigureInteractionTracker()
        {
            _interactionSource = VisualInteractionSource.Create(_rootContainer);
            _interactionSource.ScaleSourceMode     = InteractionSourceMode.EnabledWithInertia;
            _interactionSource.PositionXSourceMode = InteractionSourceMode.EnabledWithInertia;

            _tracker          = InteractionTracker.CreateWithOwner(_compositor, this);
            _tracker.MinScale = 0.6f;
            _tracker.MaxScale = 5.0f;

            _tracker.MaxPosition = new Vector3((float)Root.ActualWidth * 1.5f, 0, 0);
            _tracker.MinPosition = _tracker.MaxPosition * -1;

            _tracker.ScaleInertiaDecayRate = 0.96f;

            _tracker.InteractionSources.Add(_interactionSource);

            var tracker = _tracker.GetReference();

            //
            // Here's the trick: we take the scale output from the tracker, and convert it into a
            // value that represents Z.  Then we bind it to the world container's Z position.
            //

            var scaleExpression = EF.Lerp(0, 1000, (1 - tracker.Scale) / (1 - tracker.MaxScale));

            _worldContainer.StartAnimation("Offset.Z", scaleExpression);

            //
            // Bind the output of the tracker to the world container's XY position.
            //

            _worldContainer.StartAnimation("Offset.XY", -tracker.Position.XY);


            //
            // Scaling usually affects position.  This depends on the center point of the scale.
            // But for our UI, we want don't scale to adjust the position (since we're using scale
            // to change Offset.Z).  So to prevent scale from affecting position, we must always use
            // the top-left corner of the WorldContainer as the center point (note: we could also
            // use the tracker's negated position, since that's where WorldContainer is getting its
            // offset).
            //
            // Create input modifiers to override the center point value.
            //

            var centerpointXModifier = CompositionConditionalValue.Create(_compositor);
            var centerpointYModifier = CompositionConditionalValue.Create(_compositor);

            centerpointXModifier.Condition = _compositor.CreateExpressionAnimation("true");
            centerpointXModifier.Value     = _compositor.CreateExpressionAnimation("world.Offset.X");
            centerpointXModifier.Value.SetReferenceParameter("world", _worldContainer);

            _interactionSource.ConfigureCenterPointXModifiers(new[] { centerpointXModifier });
            _tracker.ConfigureCenterPointXInertiaModifiers(new[] { centerpointXModifier });


            centerpointYModifier.Condition = _compositor.CreateExpressionAnimation("true");
            centerpointYModifier.Value     = _compositor.CreateExpressionAnimation("world.Offset.Y");
            centerpointYModifier.Value.SetReferenceParameter("world", _worldContainer);

            _interactionSource.ConfigureCenterPointYModifiers(new[] { centerpointYModifier });
            _tracker.ConfigureCenterPointYInertiaModifiers(new[] { centerpointYModifier });
        }
Пример #16
0
        private void SetupInteraction()
        {
            if (DesignMode.DesignModeEnabled)
            {
                return;
            }
            if (Compositor == null)
            {
                return;
            }
            if (ContentBorderVisual == null)
            {
                return;
            }
            m_tracker = InteractionTracker.CreateWithOwner(Compositor, this);
            var height = (float)ContentBorder.ActualHeight;

            m_tracker.MaxPosition = new Vector3(0f, 0f, 0f);
            m_tracker.MinPosition = new Vector3(0f, -height, 0f);

            m_source = VisualInteractionSource.Create(ContentBorderVisual);
            m_source.IsPositionYRailsEnabled     = true;
            m_source.ManipulationRedirectionMode = VisualInteractionSourceRedirectionMode.CapableTouchpadOnly;
            m_source.PositionYChainingMode       = InteractionChainingMode.Auto;
            m_source.PositionYSourceMode         = InteractionSourceMode.EnabledWithoutInertia;

            m_tracker.InteractionSources.Add(m_source);

            m_open              = InteractionTrackerInertiaRestingValue.Create(Compositor);
            m_open.Condition    = Compositor.CreateExpressionAnimation("this.Target.NaturalRestingPosition.Y > -host.Size.Y / 3");
            m_open.RestingValue = Compositor.CreateExpressionAnimation("0");
            m_open.Condition.SetReferenceParameter("host", ContentBorderVisual);
            m_open.RestingValue.SetReferenceParameter("host", ContentBorderVisual);

            m_close              = InteractionTrackerInertiaRestingValue.Create(Compositor);
            m_close.Condition    = Compositor.CreateExpressionAnimation("this.Target.NaturalRestingPosition.Y <= -host.Size.Y / 3");
            m_close.RestingValue = Compositor.CreateExpressionAnimation("-host.Size.Y");
            m_close.Condition.SetReferenceParameter("host", ContentBorderVisual);
            m_close.RestingValue.SetReferenceParameter("host", ContentBorderVisual);


            //Release模式会爆炸
            //var modifiers = new InteractionTrackerInertiaRestingValue[] { m_open, m_close };
            //m_tracker.ConfigurePositionYInertiaModifiers(modifiers);


            ContentOffsetExp = Compositor.CreateExpressionAnimation("Max(-15f, -tracker.Position.Y)");
            ContentOffsetExp.SetReferenceParameter("tracker", m_tracker);
            ContentBorderVisual.StartAnimation("Translation.Y", ContentOffsetExp);

            LightDismissLayerOpacityExp = Compositor.CreateExpressionAnimation("Clamp(1 + (tracker.Position.Y / host.Size.Y),0,1)");
            LightDismissLayerOpacityExp.SetReferenceParameter("tracker", m_tracker);
            LightDismissLayerOpacityExp.SetReferenceParameter("host", ContentBorderVisual);
            LightDismissLayerVisual.StartAnimation("Opacity", LightDismissLayerOpacityExp);

            OpenAnimation = Compositor.CreateVector3KeyFrameAnimation();
            OpenAnimation.InsertExpressionKeyFrame(0f, "Vector3(0f, -host.Size.Y, 0f)");
            OpenAnimation.InsertKeyFrame(1f, new Vector3(0f, 15f, 0f));
            OpenAnimation.SetReferenceParameter("host", ContentBorderVisual);
            OpenAnimation.Duration = TimeSpan.FromSeconds(0.3d);

            ToOpenAnimation = Compositor.CreateVector3KeyFrameAnimation();
            ToOpenAnimation.InsertKeyFrame(1f, new Vector3(0f, 5f, 0f));
            ToOpenAnimation.SetReferenceParameter("host", ContentBorderVisual);
            ToOpenAnimation.Duration = TimeSpan.FromSeconds(0.3d);

            CloseAnimation = Compositor.CreateVector3KeyFrameAnimation();
            CloseAnimation.InsertExpressionKeyFrame(1f, "Vector3(0f, -host.Size.Y, 0f)");
            CloseAnimation.SetReferenceParameter("host", ContentBorderVisual);
            CloseAnimation.Duration = TimeSpan.FromSeconds(0.3d);
        }