Trying to make an animation, the same as here ru.4game.com/lineage2classic/install/
Essence - when you press a button, one picture shifts down - the other one should be taken out by the other pictures, which will replace the previous ones. I have 10 pictures (5 cut into two). I tried to do it this way.
var animDown = new ThicknessAnimation(); animDown.From = new Thickness(673, -688, -5, 0); animDown.To = new Thickness(673, 0, -4, 0); animDown.Duration = TimeSpan.FromMilliseconds(500); im2_2.BeginAnimation(Image.MarginProperty, animDown); But this code moves only one image ...
Please help
private void AnimUp(Image img) { im4_4.Margin = new Thickness(673, 686, -5, -686); var animUp = new ThicknessAnimation(); var animUp1 = new ThicknessAnimation(); if (img.Margin == new Thickness(673, 0, -4, 0)) { animUp.To = new Thickness(673, -688, -4, 0); animUp1.To = new Thickness(673, 0, -4, 0); } animUp.Duration = TimeSpan.FromMilliseconds(500); animUp1.Duration = TimeSpan.FromMilliseconds(500); img.BeginAnimation(Image.MarginProperty, animUp); im4_4.BeginAnimation(Image.MarginProperty, animUp1); im4_4.BeginAnimation(Image.MarginProperty, animUp1); } private void AnimDw(Image img) { im4.Margin = new Thickness(0, -687, 0, 0); var animDw = new ThicknessAnimation(); var animDw1 = new ThicknessAnimation(); if (img.Margin == new Thickness(0, 0, 0, 0)) { animDw.To = new Thickness(0, 687, 0, -687); animDw1.To = new Thickness(0, 0, 0, 0); } animDw.Duration = TimeSpan.FromMilliseconds(500); animDw1.Duration = TimeSpan.FromMilliseconds(500); img.BeginAnimation(Image.MarginProperty, animDw); im4.BeginAnimation(Image.MarginProperty, animDw1); } private void btnSlide_Click(object sender, RoutedEventArgs e) { AnimDw(im5); AnimUp(im5_5); } This thing works but this way: one picture shifts another and back