Esempio n. 1
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);
        }
Esempio n. 2
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);
        }
Esempio n. 3
0
        private void ResizeThumb_DragStarted(object sender, DragStartedEventArgs e)
        {
            double[] oldValue;
            this.DesignerItem = DataContext as DesignerItem;

            if (this.DesignerItem != null)
            {
                this.DesignerCanvas = VisualTreeHelper.GetParent(this.DesignerItem) as DesignerCanvas;

                if (this.DesignerCanvas != null)
                {
                    oldValueList.Clear();
                    foreach (DesignerItem item in this.DesignerCanvas.SelectedItems)
                    {
                        item.canvas = this.DesignerCanvas;
                        Point p = new Point();
                        //p = item.TranslatePoint(
                        //new Point(0,0),
                        //          this.DesignerCanvas);
                        // item.centerPoint = item.TranslatePoint(
                        //new Point(item.ActualWidth/2,
                        //          item.ActualHeight/ 2),
                        //          this.DesignerCanvas);



                        Point startPoint = Mouse.GetPosition(this.DesignerCanvas);
                        item.StartVector = Point.Subtract(startPoint, item.centerPoint);

                        item.RotateTransform = item.RenderTransform as RotateTransform;
                        if (item.RotateTransform == null)
                        {
                            item.RenderTransform = new RotateTransform(0);

                            item.InitialAngle = 0;
                        }
                        else
                        {
                            item.InitialAngle = item.RotateTransform.Angle;
                        }

                        oldValue = new double[5] {
                            item.GetHashCode(), item.ActualWidth, item.ActualHeight, Canvas.GetLeft(item), Canvas.GetTop(item)
                        };
                        oldValueList.Add(oldValue);
                    }
                }
            }
        }
Esempio n. 4
0
        private void MoveThumb_DragStarted(object sender, DragStartedEventArgs e)
        {
            double[] oldValue;
            this.DesignerItem = DataContext as DesignerItem;

            if (this.DesignerItem != null)
            {
                this.DesignerCanvas = VisualTreeHelper.GetParent(this.DesignerItem) as DesignerCanvas;
                oldValueList.Clear();
                foreach (DesignerItem item in this.DesignerCanvas.SelectedItems)
                {
                    oldValue = new double[5] {
                        item.GetHashCode(), item.ActualWidth, item.ActualHeight, Canvas.GetLeft(item), Canvas.GetTop(item)
                    };
                    oldValueList.Add(oldValue);
                }
            }
        }
Esempio n. 5
0
 public PropertyFontBoldCommand(DesignerItem item)
 {
     _item = item;
 }
Esempio n. 6
0
 public PropertyRotateCommand(DesignerItem item)
 {
     _item = item;
 }
Esempio n. 7
0
 public ControlRemove(DesignerItem contentControl)
 {
     _contentcontrol = contentControl;
     _contentCanvas  = _contentcontrol.Parent as DesignerCanvas;
 }
Esempio n. 8
0
 public ControlMoveOrResize(DesignerItem item)
 {
     _item = item;
 }
Esempio n. 9
0
 public PropertySkewYCommand(DesignerItem item)
 {
     _item = item;
 }
Esempio n. 10
0
 public PropertyTranslateYCommand(DesignerItem item)
 {
     _item = item;
 }
Esempio n. 11
0
 public PropertyScaleXCommand(DesignerItem item)
 {
     _item = item;
 }
Esempio n. 12
0
 public ControlCreate(DesignerItem item)
 {
     _item          = item;
     _contentCanvas = _item.Parent as DesignerCanvas;
 }
Esempio n. 13
0
 public PropertyFontSizeCommand(DesignerItem item)
 {
     _item = item;
 }
Esempio n. 14
0
 public PropertyOpacityCommand(DesignerItem item)
 {
     _item = item;
 }
Esempio n. 15
0
 public PropertyWidthCommand(DesignerItem item)
 {
     _item = item;
 }
Esempio n. 16
0
 public PropertyHeightCommand(DesignerItem item)
 {
     _item = item;
 }
Esempio n. 17
0
 public PropertyFontItalicCommand(DesignerItem item)
 {
     _item = item;
 }