private void CloseCommitDetails_Executed(object sender, ExecutedRoutedEventArgs e)
{
try
{
if (e.Parameter == null)
{
var animationDuration = TimeSpan.FromSeconds(.2);
var animation = new DoubleAnimation(this.ActualWidth + 200, new Duration(animationDuration));
animation.EasingFunction = new CubicEase() { EasingMode = EasingMode.EaseIn };
animation.Completed += (o, _) => this.details.Visibility = Visibility.Collapsed;
this.details.RenderTransform.BeginAnimation(TranslateTransform.XProperty, animation);
}
else
{
var animationDuration = TimeSpan.FromSeconds(.2);
var animation = new DoubleAnimation(-this.ActualWidth, new Duration(animationDuration));
animation.EasingFunction = new CubicEase() { EasingMode = EasingMode.EaseIn };
animation.Completed += (o, _) => this.pendingChanges.Visibility = Visibility.Collapsed;
this.pendingChanges.RenderTransform.BeginAnimation(TranslateTransform.XProperty, animation);
}
}
catch (Exception ex)
{
Log.WriteLine("MainWindow.CloseCommitDetails_Executed: {0}", ex.ToString());
}
}