Skip to main content

Microsoft Silverlight

Answered Question Picture slide showRSS Feed

(0)

ramakish
ramakish

Member

Member

13 points

16 Posts

Picture slide show

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 nanavati
jay nana...

Contributor

Contributor

3388 points

624 Posts

Answered Question

Re: Picture slide show

Why you need two storyboard? you can include both animation in one storyboard and try. It will work.

Jay K Nanavaty
www.technologyopinion.com
Mark as answer if it helps. It will also help others...

ramakish
ramakish

Member

Member

13 points

16 Posts

Re: Re: Picture slide show

Thanks for the prompt reply but I have tried that approach. but did not work.

jay nanavati
jay nana...

Contributor

Contributor

3388 points

624 Posts

Answered Question

Re: Re: Re: Picture slide show

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.

Jay K Nanavaty
www.technologyopinion.com
Mark as answer if it helps. It will also help others...

ramakish
ramakish

Member

Member

13 points

16 Posts

Re: Re: Re: Re: Picture slide show

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" is
present in my page.xaml. so what would be the problem?

jay nanavati
jay nana...

Contributor

Contributor

3388 points

624 Posts

Answered Question

Re: Re: Re: Re: Re: Picture slide show

It sees for imagewindow in app.xaml. so you need to set TargetName dynamically from
code behind.

 

Jay K Nanavaty
www.technologyopinion.com
Mark as answer if it helps. It will also help others...

jay nanavati
jay nana...

Contributor

Contributor

3388 points

624 Posts

Answered Question

Re: Re: Re: Re: Re: Re: Picture slide show

you can do like this:

FadeAnimation.SetValue(Storyboard.TargetNameProperty, imageWindow.Name)

FadeAnimation.Begin();

Jay K Nanavaty
www.technologyopinion.com
Mark as answer if it helps. It will also help others...

ramakish
ramakish

Member

Member

13 points

16 Posts

Re: Re: Re: Re: Re: Re: Re: Picture slide show

great, it is working now. thanks for all the helpSmile

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities