1. HtmlTimer is deprecated and not very reliable (incase you want to use it here is the basic code to get it working
2. System.Threading.Timer. Not really an option because there’s no way to marshal it’s callbacks back onto the UI thread
3. Storyboard in XAML and wired a handler to its Completed events. I used the inline event on the xAML instead of wiring up the event in code because it wasn’t behaving properly.





3 responses so far ↓
Vlad // April 30, 2008 at 10:44 pm |
http://blogs.msdn.com/silverlight_sdk/archive/2008/03/27/make-a-silverlight-timer-silverlight-2.aspx
Jacek Ciereszko // April 18, 2009 at 1:08 pm |
Hi,
Yor forgot about “DispatcherTimer ” which I think is much better to count time.
see: http://msdn.microsoft.com/en-us/library/cc189084(VS.95).aspx
Regards,
Jacek
Daniel // May 26, 2009 at 8:06 am |
System.Threading.Timer may be used you merely have to make a cross thread call to access the UI thread. To do this do the following:
this.Dispatcher.BeginInvoke(new Action(new Action(TheSubtaskToCall)));