Silverlight 4 等效于 .NET 计时器控件 [英] Silverlight 4 Equivalent to .NET Timer Control

查看:24
本文介绍了Silverlight 4 等效于 .NET 计时器控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

基本上我想在我的项目中插入一个动态时钟.现在我正在使用 dateTime 控件,它很好,但它是静态的.我需要时钟每秒更改数字.在 c# 中有一个 Timer 控件,我可以使用它来使这个动态时钟成为可能.但是,在 Silverlight 4 中,我无法找到任何类型的 Timer Control 以用于构建此动态时钟.

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

DispatcherTimer Class

http://msdn.microsoft.com/en-us/library/system.windows.threading.dispatchertimer(VS.95).aspx

对于非 UI 使用,您还有 Timer 类

for non-UI use you also have the Timer Class

http://msdn.microsoft.com/en-us/library/system.threading.timer(v=VS.95).aspx

这篇关于Silverlight 4 等效于 .NET 计时器控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆