//boxItem要移动的控件 
              DoubleAnimation doubleAnimation = new DoubleAnimation();
                        doubleAnimation.Duration = new Duration
                            (TimeSpan.FromSeconds(5));

                        TranslateTransform transform = new TranslateTransform();
                        boxItem.RenderTransform = transform;
                        transform.X = 0;
                    
                                doubleAnimation.To = 100;
                 
                            transform.BeginAnimation(TranslateTransform.XProperty, doubleAnimation);
                        }

 

相关文章: