private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
if (!_doingExitAnimation)
{
_doingExitAnimation = true;
e.Cancel = true;
var anim = new DoubleAnimation(0, (Duration)TimeSpan.FromSeconds(Settings.FadeInTime));
anim.AccelerationRatio = 0.4;
anim.DecelerationRatio = 0.6;
anim.Completed += (s, _) => this.Close();
this.BeginAnimation(UIElement.OpacityProperty, anim);
}
}