//Animations public void AllRectanglesLoaded() { //animation code DoubleAnimation firstLoginRectangle = new DoubleAnimation() { From = 0, To = 920, Duration = TimeSpan.FromSeconds(1), EasingFunction = new QuinticEase() }; DoubleAnimation firstVSRectangle = new DoubleAnimation() { From = 0, To = 920, Duration = TimeSpan.FromSeconds(1), EasingFunction = new QuinticEase() }; DoubleAnimation firstCodeCompRectangle = new DoubleAnimation() { From = 0, To = 920, Duration = TimeSpan.FromSeconds(1), EasingFunction = new QuinticEase() }; DoubleAnimation darkModeRectangle = new DoubleAnimation() { From = 0, To = 920, Duration = TimeSpan.FromSeconds(1), EasingFunction = new QuinticEase() }; //calling the animation code //reffering to the XAML objects FirstLoginRec.BeginAnimation(WidthProperty, firstLoginRectangle); FirstVSRec.BeginAnimation(WidthProperty, firstVSRectangle); FirstCodeCompRec.BeginAnimation(WidthProperty, firstCodeCompRectangle); DarkModeRec.BeginAnimation(WidthProperty, darkModeRectangle); }
public void AllRectanglesUnloaded() { DoubleAnimation firstLoginRectangle = new DoubleAnimation() { From = 920, To = 0, Duration = TimeSpan.FromSeconds(1), EasingFunction = new QuinticEase() }; DoubleAnimation firstVSRectangle = new DoubleAnimation() { From = 920, To = 0, Duration = TimeSpan.FromSeconds(1), EasingFunction = new QuinticEase() }; DoubleAnimation firstCodeCompRectangle = new DoubleAnimation() { From = 920, To = 0, Duration = TimeSpan.FromSeconds(1), EasingFunction = new QuinticEase() }; DoubleAnimation darkModeRectangle = new DoubleAnimation() { From = 920, To = 0, Duration = TimeSpan.FromSeconds(1), EasingFunction = new QuinticEase() }; FirstLoginRec.BeginAnimation(WidthProperty, firstLoginRectangle); FirstVSRec.BeginAnimation(WidthProperty, firstVSRectangle); FirstCodeCompRec.BeginAnimation(WidthProperty, firstCodeCompRectangle); DarkModeRec.BeginAnimation(WidthProperty, darkModeRectangle); }