/// <summary> /// Hides a grid, fades and scales it out /// </summary> /// <param name="grid">The grid to animate</param> /// <param name="seconds">The time the animation will take</param> /// <returns></returns> public static async Task HideScaleAndFadeOut(this Grid grid, float seconds) { Storyboard s = new Storyboard(); s.AddScaleXAnimation(grid, 1, 0, seconds); s.AddScaleYAnimation(grid, 1, 0, seconds); s.AddFadeIn(grid, 1, 0, seconds); s.Begin(); // Wait for it to finish await Task.Delay((int)(seconds * 1000)); }