private void ToggleItemsFilledOpacityAnimation(bool visible) { if (opacityAnimation != null) { opacityAnimation.Stop(); } if (visible) { Opacity = 0; } else { Opacity = 1; } opacityAnimation = ArtefactAnimator.AddEase(this, "Opacity", visible ? 1 : 0, 0.5); }
public void AnimateToDropShadow() { if (DropShadowAnimation != null) { DropShadowAnimation.Stop(); } if (DropShadowOpacity < 1) { Events.OnIdleOnce( () => { DropShadowAnimation = ArtefactAnimator.AddEase(this, new[] { "DropShadowOpacity" }, new object[] { 1.0 }, 0.25d); }); } }
protected void UpdateOpacity(bool visibility) { if (activeOpacityAnimation != null) { activeOpacityAnimation.Stop(); } if (visibility == false) { Opacity = 0; } else { var seconds = 0.5; activeOpacityAnimation = ArtefactAnimator.AddEase(this, new[] { "Opacity" }, new object[] { 1 }, seconds); activeOpacityAnimation.Complete += (easeObj, percent) => { activeOpacityAnimation = null; }; } }