Exemple #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);
        }
Exemple #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);
        }
Exemple #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);
                    }
                }
            }
        }
Exemple #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);
                }
            }
        }
Exemple #5
0
 public PropertyFontBoldCommand(DesignerItem item)
 {
     _item = item;
 }
Exemple #6
0
 public PropertyRotateCommand(DesignerItem item)
 {
     _item = item;
 }
Exemple #7
0
 public ControlRemove(DesignerItem contentControl)
 {
     _contentcontrol = contentControl;
     _contentCanvas  = _contentcontrol.Parent as DesignerCanvas;
 }
Exemple #8
0
 public ControlMoveOrResize(DesignerItem item)
 {
     _item = item;
 }
Exemple #9
0
 public PropertySkewYCommand(DesignerItem item)
 {
     _item = item;
 }
Exemple #10
0
 public PropertyTranslateYCommand(DesignerItem item)
 {
     _item = item;
 }
Exemple #11
0
 public PropertyScaleXCommand(DesignerItem item)
 {
     _item = item;
 }
Exemple #12
0
 public ControlCreate(DesignerItem item)
 {
     _item          = item;
     _contentCanvas = _item.Parent as DesignerCanvas;
 }
Exemple #13
0
 public PropertyFontSizeCommand(DesignerItem item)
 {
     _item = item;
 }
Exemple #14
0
 public PropertyOpacityCommand(DesignerItem item)
 {
     _item = item;
 }
Exemple #15
0
 public PropertyWidthCommand(DesignerItem item)
 {
     _item = item;
 }
Exemple #16
0
 public PropertyHeightCommand(DesignerItem item)
 {
     _item = item;
 }
Exemple #17
0
 public PropertyFontItalicCommand(DesignerItem item)
 {
     _item = item;
 }