8,737
社区成员
发帖
与我相关
我的任务
分享
public static void PowerStandBy(double top,double left,UIElement elem)
{
try
{
DoubleAnimation floatY = new DoubleAnimation();
floatY.Duration = new TimeSpan(0,0,0,1,0);
floatY.To = top;
DoubleAnimation floatX = new DoubleAnimation();
floatX.Duration = new TimeSpan(0,0,0,1,0);
floatX.To = top;
elem.BeginAnimation(Canvas.TopProperty,floatY);
elem.BeginAnimation(Canvas.LeftProperty,floatX);
}
}
private void Power_MouseEnter(object sender,MouseEventArgs e)
{
if(!PowerIsStandBy)
{
PowerStandBy(100,100,Power);
PowerStandBy = true;
}
}