//淡入淡出 void AssetActionFade(AssetActionInfo assetAction, DesignerItem item, double fromValue, double toValue) { DoubleAnimation doubleAnimation = new DoubleAnimation(fromValue, toValue, new Duration(GetSpan(assetAction.Time))); doubleAnimation.FillBehavior = FillBehavior.HoldEnd; doubleAnimation.Completed += (sender, e) => { item.BeginAnimation(DesignerItem.OpacityProperty, null); }; item.BeginAnimation(DesignerItem.OpacityProperty, doubleAnimation, HandoffBehavior.SnapshotAndReplace); }
//左侧飞入 void AssetActionMove(AssetActionInfo assetAction, DesignerItem item, double fromValue, double toValue) { DoubleAnimation doubleAnimation = new DoubleAnimation(fromValue, toValue, new Duration(GetSpan(assetAction.Time))); doubleAnimation.FillBehavior = FillBehavior.HoldEnd; doubleAnimation.Completed += (sender, e) => { item.BeginAnimation(Canvas.LeftProperty, null); }; item.BeginAnimation(Canvas.LeftProperty, doubleAnimation); }