Ejemplo n.º 1
0
        private void NewFlexGrid_Unloaded(object sender, RoutedEventArgs e)
        {
            if (_offsetXAnimation != null)
            {
                _offsetXAnimation.Dispose();
                _offsetXAnimation = null;
            }

            //don't dispose at this moment,some page NavigationCacheMode is required
            //you must dispose it at page back.
            //if (_scrollerViewerManipulation != null)
            //{
            //    _scrollerViewerManipulation.Dispose();
            //    _scrollerViewerManipulation = null;
            //}
        }
Ejemplo n.º 2
0
        public override void ReleaseResources()
        {
            if (_effectFactory != null)
            {
                _effectFactory.Dispose();
                _effectFactory = null;
            }

            if (_enterAnimation != null)
            {
                _enterAnimation.Dispose();
                _enterAnimation = null;
            }

            if (_exitAnimation != null)
            {
                _exitAnimation.Dispose();
                _exitAnimation = null;
            }

            if (_transformExpression != null)
            {
                _transformExpression.Dispose();
                _transformExpression = null;
            }

            if (_propertySet != null)
            {
                _propertySet.Dispose();
                _propertySet = null;
            }
        }
Ejemplo n.º 3
0
 private void Page_Unloaded(object sender, RoutedEventArgs e)
 {
     if (parallaxAnimation0 != null)
     {
         parallaxAnimation0.Dispose();
         parallaxAnimation0 = null;
     }
     if (parallaxAnimation1 != null)
     {
         parallaxAnimation1.Dispose();
         parallaxAnimation1 = null;
     }
     if (parallaxAnimation2 != null)
     {
         parallaxAnimation2.Dispose();
         parallaxAnimation2 = null;
     }
     if (parallaxAnimation3 != null)
     {
         parallaxAnimation3.Dispose();
         parallaxAnimation3 = null;
     }
     if (parallaxAnimation4 != null)
     {
         parallaxAnimation4.Dispose();
         parallaxAnimation4 = null;
     }
     if (scrollViewerProperties != null)
     {
         scrollViewerProperties.Dispose();
         scrollViewerProperties = null;
     }
     IndAni.Stop();
 }
Ejemplo n.º 4
0
 protected override void OnDisconnected(UIElement oldElement)
 {
     // Dispose Light and Composition resources when it is removed from the tree
     HoverLight.RemoveTargetElement(GetId(), oldElement);
     CompositionLight.Dispose();
     _lightPositionExpression.Dispose();
     _offsetAnimation.Dispose();
 }
        private void Page_Unloaded(object sender, RoutedEventArgs e)
        {
            if (_parallaxExpression != null)
            {
                _parallaxExpression.Dispose();
                _parallaxExpression = null;
            }

            if (_scrollProperties != null)
            {
                _scrollProperties.Dispose();
                _scrollProperties = null;
            }
        }
Ejemplo n.º 6
0
        private void NewFlexGrid_Unloaded(object sender, RoutedEventArgs e)
        {
            if (_offsetXAnimation != null)
            {
                _offsetXAnimation.Dispose();
                _offsetXAnimation = null;
            }

            //if (_scrollerViewerManipulation != null)
            //{
            //    _scrollerViewerManipulation.Dispose();
            //    _scrollerViewerManipulation = null;
            //}
        }
        /// <summary>
        /// Called when the behavior is being detached from its <see cref="Microsoft.Xaml.Interactivity.Behavior.AssociatedObject"/>.
        /// </summary>
        protected override void OnDetaching()
        {
            base.OnDetaching();

            _compositor?.Dispose();
            _scrollerViewerManipulation?.Dispose();
            _rotationAnimation?.Dispose();
            _opacityAnimation?.Dispose();
            _offsetAnimation?.Dispose();
            _resetAnimation?.Dispose();
            _loadingAnimation?.Dispose();
            _borderVisual?.Dispose();
            _refreshIconVisual?.Dispose();

            AssociatedObject.Loaded   -= OnAssociatedObjectLoaded;
            AssociatedObject.Unloaded -= OnAssociatedObjectUnloaded;
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Releases all resources used by this ExpressionNode.
        /// </summary>
        public void Dispose()
        {
            _objRefList            = null;
            _compObjToParamNameMap = null;
            _constParamMap         = null;
            Subchannels            = null;
            PropertyName           = null;
            NodeType = ExpressionNodeType.Count;

            // Note: we don't recursively dispose all child nodes, as those nodes could be in use by a different Expression
            Children = null;

            if (ExpressionAnimation != null)
            {
                ExpressionAnimation.Dispose();
                ExpressionAnimation = null;
            }
        }
Ejemplo n.º 9
0
        //warning
        internal void StopAnimation()
        {
            if (_frozenContentVisual != null)
            {
                _frozenContentVisual.StopAnimation("Offset.X");
                _frozenContentVisual.Dispose();
                _frozenContentVisual = null;

                _pressedHiderVisual.StopAnimation("Offset.X");
                _pressedHiderVisual.Dispose();
                _pressedHiderVisual = null;

                _compositor.Dispose();
                _compositor = null;
                _offsetAnimation.Dispose();
                _offsetAnimation = null;
                _scrollerViewerManipulation.Dispose();
                _scrollerViewerManipulation = null;
            }
        }
Ejemplo n.º 10
0
        private void BuildExpressionAnimation()
        {
            if (_expressionAnimation != null)
            {
                _cameraVisual.StopAnimation("transformMatrix");
                _expressionAnimation.Dispose();
            }
            _expressionAnimation = _cameraVisual.Compositor.CreateExpressionAnimation();
            if (_orthographic)
            {
                _expressionAnimation.Expression = _expressionOrthographic;
            }
            else
            {
                _expressionAnimation.Expression = _expressionPerspective;
            }
            _expressionAnimation.SetReferenceParameter("properties", _cameraVisual.Properties);

            if (_animationActive)
            {
                StartAnimation();
            }
        }