Toast Slide with Easing

时间:2014-10-17 17:51:08

标签: c# wpf

我有一个“Toast”WPF窗口从屏幕右下角滑入 - 如何添加 轻松弹回一点反弹

var anim = new DoubleAnimation
{
    Duration = TimeSpan.FromMilliseconds(280),
    From = Left,
    To = Left - (Width * 2),
};
this.BeginAnimation(Window.LeftProperty, anim); 

1 个答案:

答案 0 :(得分:0)

var anim = new DoubleAnimation
{
    Duration = TimeSpan.FromMilliseconds(280),
    From = Left,
    To = Left - (Width * 2),
    EasingFunction = new BounceEase()
};

DoubleAnimation Class (System.Windows.Media.Animation) - MSDN
Easing Functions - MSDN