很简单的,只需要把位置改变下就好了,动画的话,就要用动画元素了。
这个简单
Storyboard s = new Storyboard();
DoubleAnimationUsingKeyFrames d = new DoubleAnimationUsingKeyFrames();
d.KeyFrames.Add(new LinearDoubleKeyFrame(30,KeyTime.FromTimeSpan(TimeSpan.FromSeconds(0.6))));
d.KeyFrames.Add(new LinearDoubleKeyFrame(变动终值, KeyTime.FromTimeSpan(TimeSpan.FromSeconds(0.8))));
s.Children.Add(d);
Storyboard.SetTargetName(d, 目标名);
Storyboard.SetTargetProperty(d, new PropertyPath(Canvas.LeftProperty));
s.Begin(bor);
中间那个d是加了关键帧了,我就不摘出来了,不喜欢关键帧去点就行了