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; } }
public void UpdateAction(ChatAction action) { var type = GetAnimationType(action); if (type == _action) { return; } if (_previous != null) { _previous.Dispose(); _previous = null; } if (_props != null) { _props.Dispose(); _props = null; } var color = Fill?.Color ?? Colors.Black; var visual = GetVisual(type, Window.Current.Compositor, color, out _props); _action = type; _previous = visual; ElementCompositionPreview.SetElementChildVisual(this, visual?.RootVisual); InvalidateArrange(); }
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(); }
private void Page_Unloaded(object sender, RoutedEventArgs e) { if (_parallaxExpression != null) { _parallaxExpression.Dispose(); _parallaxExpression = null; } if (_scrollProperties != null) { _scrollProperties.Dispose(); _scrollProperties = null; } }
//you must dispose it at page back. public void Dispose() { if (_offsetXAnimation != null) { _offsetXAnimation.Dispose(); _offsetXAnimation = null; } if (_scrollerViewerManipulation != null) { _scrollerViewerManipulation.Dispose(); _scrollerViewerManipulation = null; } }
private void Page_Unloaded(object sender, RoutedEventArgs e) { if (_parallaxExpression != null) { // (TODO) Re-add this in after Dispose() implemented on ExpressionNode //_parallaxExpression.Dispose(); _parallaxExpression = null; } if (_scrollProperties != null) { _scrollProperties.Dispose(); _scrollProperties = 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; }
//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; } }