Exemple #1
0
        void UnAssetAction(AssetActionInfo assetAction, DesignerItem item)
        {
            DesignerCanvas canvas = item.Parent as DesignerCanvas;

            if (canvas == null)
            {
                return;
            }
            if (item == null)
            {
                return;
            }
            switch (assetAction.AssetAction)
            {
            case enumAssetAction.Fade:
                AssetActionFade(assetAction, item, 1, 0);
                break;

            case enumAssetAction.Left:
                AssetActionMove(assetAction, item, Canvas.GetLeft(item) + canvas.ActualWidth, Canvas.GetLeft(item));
                break;

            case enumAssetAction.Right:
                AssetActionMove(assetAction, item, Canvas.GetLeft(item), Canvas.GetLeft(item) - canvas.ActualWidth);

                break;
            }
        }
Exemple #2
0
        //淡入淡出
        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);
        }
Exemple #3
0
        //左侧飞入
        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);
        }