Get Started

How to add Silverlight Count Down to your html code

If you want to add Silverlight Count Down to your website, you can do this by adding it to your html code.
You need download already compiled application (Working application with HTML configuration) and change settings in "SilverlightCountDownTimerExampleTestPage.html" file.

<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
   <param name="source" value="ClientBin/SilverlightCountDownTimerExample.xap"/>		
   <param name="initParams" 
	value="EventDescription=Time to New Year Party, 
	EventTime=2010-01-01 00:00
	/>
</object>
Code above will set counter to 1 January 2010.

Configuration options

EventDescription – Event's description. This text will be displaied in the bottom of control,
EventTime – Event time,
EventTimeUrl – Url to file with event's date. This file can be hosted on different server and when you modified it, event's time change dynamically. Example of file you can see here http://wpierdalaj.pl/SWG/date.txt. This file have to be accessible for your application (see Client Access Policy on Tim Heuer's blog. Because EventTime and EventTimeUrl, both set event's time, EventTime was chosen as a one with higher priority. It's mean that if you would like to use EventTimeUrl, you can't set EventTime parameter,
EventTimeCache – This parameter will let you turn on/off caching for event's time,
EventTimeCacheDuration – How long cache will remember saved event's date. If you set 40, application will not read new event's date for 40 days.

Example:
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
   <param name="source" value="ClientBin/SilverlightCountDownTimerExample.xap"/>		
   <param name="onerror" value="onSilverlightError" />
   <param name="background" value="white" />
   <param name="minRuntimeVersion" value="2.0.31005.0" />
   <param name="autoUpgrade" value="true" />

   <!--// EventTimeUrl will be ignored because EventTime is set-->
   <param name="initParams" 
     value="EventDescription=Time to MIX 2010, 
     EventTime=2010-03-15 08:00, 
     EventTimeUrl=http://wpierdalaj.pl/SWG/date.txt, 
     EventTimeCache=True, 
     EventTimeCacheDuration=40" 
   />

</object>

Last edited Jun 17, 2009 at 3:07 PM by DZaK, version 6

Comments

pawlos Apr 28, 2009 at 2:24 PM 
I'm not sure whether you should show examples with minVersion set to 3.0.40307.0. Is it not working with version 2.0 of SL?