New Silverlight Video Tutorial: How to make a Timer Using the DispatcherTimer Class


In this short video I show you how to create a Silverlight Timer using the DispatcherTimer class. I then show you a real world example where you would use a timer in Silverlight.

Video: http://tw0.us/4o6

Project Download: http://tw0.us/4mr

Advertisements
  1. Nice tutorial. Two things came to mind while watching it.

    When the little bar suggesting a using is needed comes up, you showed the two ways to resolve it, but there is another, quicker way I use all the time.The Ctrl+. (Ctrl + period) shortcut opens the context menu and hitting enter then accepts the first entry, which is usually the one you want.

    When initialising a timespan, I used the “new TimeSpan(h, m, s)” syntax for ages myself, until I discovered that the TimeSpan has some nice static methods for initialising timespans. So instead of “dt.Interval = new TimeSpan(0, 0, 4);” you could have used “dt = TimeSpan.FromSeconds(4);”, which I think makes the code just that little bit more readable.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: