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