【发布时间】:2011-01-12 15:38:49
【问题描述】:
我使用附加属性Canvas.Top 和Canvas.Left 将一个元素定位在Canvas 上。然后使用动画将元素移动到不同的坐标集,如下所示:
DoubleAnimation left = new DoubleAnimation( oldLeft, newLeft );
DoubleAnimation top = new DoubleAnimation( oldTop, newTop );
element.BeginAnimation( Canvas.LeftProperty, left );
element.BeginAnimation( Canvas.TopProperty, top );
有没有办法在Canvas.Top 或Canvas.Left 更改时接收事件?最好与动画无关。
【问题讨论】:
标签: c# wpf canvas attached-properties