Skip to main content
Home Forums Silverlight Programming Programming with .NET - General Picture slide show
7 replies. Latest Post by ramakish on July 4, 2009.
(0)
ramakish
Member
13 points
16 Posts
07-04-2009 1:01 PM |
I am building simple picture slide show application. Here I made two animation Fade_In and Fade_Out.
Upon changing image, I want that current image first fade out and than slightly next image comes in fade in fasion.
But this is not happening.. when I do fadeout and than set Image source, the 2nd image comes quickly without fade in..
any help?
jay nana...
Contributor
3388 points
624 Posts
07-04-2009 1:04 PM |
Why you need two storyboard? you can include both animation in one storyboard and try. It will work.
07-04-2009 1:05 PM |
Thanks for the prompt reply but I have tried that approach. but did not work.
07-04-2009 1:08 PM |
ohh.. I forgot to explain well. I mean, you can think like this:
create storyboard named FadeAnimation. and add DoubleAnimation
which fade out the opacity of the Image control from 1 to 0.5 with duration 1 sec.
and set storyboard AutoReverse property to True. So when you begin it, it will first
fadout and than as auto reverse set to true, it will fade in and you can see
smooth transition between image.
07-04-2009 1:13 PM |
yes, it worked. thanks. now the problem is, I have moved animation to app.xaml so other controls can use it.so I am getting Target name "imageWindow" not found kind error. but "imageWindow" ispresent in my page.xaml. so what would be the problem?
07-04-2009 1:15 PM |
It sees for imagewindow in app.xaml. so you need to set TargetName dynamically fromcode behind.
you can do like this:
FadeAnimation.SetValue(Storyboard.TargetNameProperty, imageWindow.Name)
FadeAnimation.Begin();
07-04-2009 1:18 PM |
great, it is working now. thanks for all the help