Toast Slide with Easing

本文关键字:Easing with Slide Toast | 更新日期: 2023-09-27 18:26:52

我有一个从屏幕右下角滑入的"Toast"WPF窗口-如何添加轻松浏览反弹一点的幻灯片

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

Toast Slide with Easing

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

DoubleAnimation类(System.Windows.Media.Animation)-MSDN
简化功能-MSDN