I have an animation which moves a grid to a specific place and then automatically goes back using AutoReverse. But since it's instant the user cannot read the message inside of it. How can I put a -for example- 5 seconds delay in the animation
Here is the method I have so far
public void ErrorMessage(Grid grid, ImageSource imageSource, String error_message)
{
Image_Broken_Component.Source = imageSource;
TextBlock_Error_Message.Text = error_message;
ThicknessAnimation ta = new ThicknessAnimation
{
From = grid.Margin,
To = new Thickness(0, 50, 0, 0),
Duration = new Duration(TimeSpan.FromSeconds(1)),
AutoReverse = true
};
grid.BeginAnimation(Grid.MarginProperty, ta);
}
The animation should play like this (using the From and To-values): 1 -> 0 -> wait 5s -> 1