Skip to main content

Microsoft Silverlight

Unanswered Question Animations not working if browser size is smaller than Silverlight form.RSS Feed

(0)

gp100mk
gp100mk

Member

Member

7 points

58 Posts

Animations not working if browser size is smaller than Silverlight form.

I have a Silverlight application where the user can click on a menu button to go to a different form. When the user clicks on a menu option I display the relevant form using a "fade-in" animation. This animation is achieved by changing the Opacity from 0 to 1.

What I have found is that when the browser is resized to make it smaller than the Silverlight form, the animation no longer works. This results in the form displaying immediately with the Opacity set to a value anywhere between 0 and 1 with no animation (the results vary each time). The controls then only appear with full opacity if the mouse pointer is moved over them.

I have created a test project which re-creates this issue. Because the animation doesn't happen the first time the page is loaded (I don't know why - but I have found that to be the case with any form_Loaded animation), you will need to hit F5 to refresh the page each time.

If you change the size of the browser so that it is just big enough to see all of the fields and hit F5 you can easilly re-create this bug.

Thanks for your help - I would be grateful for any workarounds.

Abhi319
Abhi319

Member

Member

122 points

52 Posts

Re: Animations not working if browser size is smaller than Silverlight form.

Hello,

Your project is  working fine and the animation fade-in that you have putted is working fine.

The reson why its not showing is that : the startup page takes some time to display the page and in the mean while the storyborad starts and its not too long that it will continue.

Once ur page got loaded then you refresh the page then u will see that ur animation is working fine. On making start up animation on page load sometime the problem occurs. That is not actually a problem its our illusion that its not working.

And one more importent thing is abt your another problem is : plz do one change--> In startup aspx page chage the silverlight height and width 100% to 1280 and 1024 or something else. This will resolve ur second problem

Hope this will help you....and plz let me know more about ur problem

Abhishek Goel

gp100mk
gp100mk

Member

Member

7 points

58 Posts

Re: Re: Animations not working if browser size is smaller than Silverlight form.

Thanks for your reply.

Your explanation of why the page animation doesn't happen on application startup is fine - I can accept that.

Changing the aspx page size as you describe does in fact fix the animation problem. However, this solution is not an option form me, as the elements on my form need to scale to the size of the page. I am using App.Current.Host.Content.ActualWidth and App.Current.Host.Content.ActualHeight to determine the size of the browser window so that I can scale my controls accordingly. When we increase the size of the page these values no longer correspond to the size of the browser window, but to the height and width I have fixed the aspx page to.

Is there something else I can use to determine brwoser size other than App.Current.Host.Content.ActualWidth and App.Current.Host.Content.ActualHeight?

 

 

gp100mk
gp100mk

Member

Member

7 points

58 Posts

Re: Re: Animations not working if browser size is smaller than Silverlight form.

Could someone please acknowledge that this is a bug, so that the problem can be addressed?

My company is using Silverlight to develop an application for the first time. Unless there are workarounds for this issue and for others which I have encountered, it is my view that Silverlight is not a 'mature' enough product yet to be used for developing software. We have found software development to be a very painful and time-consuming process so far, but are impressed by the results that can be achieved using Silverlight - so we would like to persevere.

Thanks for your help.

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities