Hi, i have a problem in state animation.
I have an image and a
button. When i click the button i want to make an animation which make
the opacity of my image to be 0, change the source of my image in run
time, and then make the opacity of my image to be 100 again.
To
do this animation i make 2 state manager, which first called "dark"
which change the opacity of my image to be 0, second is called "bright"
which turn back the opacity of my image to be 100.
and then i write the code like this :
private void mybtn_Click(object sender, RoutedEventArgs e)
{
VisualStateManager.GoToState(this, "dark", true);
image.Source = new BitmapImage(new Uri(GetURLBase() + "images/stadium/arsenal1.jpg"));
VisualStateManager.GoToState(this, "bright", true);
}
but
it doesn't work like what i want. The image source change first before
the animation begin, so the order of animation is change the image
source, change the opacity to be 0, then change back the opacity to be
100.
can somebody help me how to change the image source in the middle of that 2 state manager?
Thank you for your attention.