Basically I'm wanting to insert a dynamic clock in my project. Right now I'm using the dateTime control which is fine but it's static. I need the clock to change digits with each second. In c# there is a Timer control that I would be able to use to make this dynamic clock possible. However, in Silverlight 4 I have not been able to locate any kind of Timer Control whatsoever to use in building this dynamic clock.
I didn't know if I was just looking in the wrong place or if it's right under my nose and I'm just missing it or what. Also, I assume using a timer control would be the best, however if there开发者_运维技巧's a better approach to this please let me know that as well.
DispatcherTimer Class
http://msdn.microsoft.com/en-us/library/system.windows.threading.dispatchertimer(VS.95).aspx
for non-UI use you also have the Timer Class
http://msdn.microsoft.com/en-us/library/system.threading.timer(v=VS.95).aspx
In case, you are interested in a working demo, you can try the solution from...
http://www.dotnetscraps.com/dotnetscraps/post/Silverlight-e28093-Create-a-binary-clock.aspx
Hope this helps!
精彩评论