我有一个函数叫做Checking()
来更新我的用户界面。我想使这个函数AutoRun和它每秒运行它并更新我的UI。C#自动检查功能
我该怎么做?
这里是我的功能:
public MainWindow()
{
InitializeComponent();
Checking()
}
public void Checking()
{
if (status= Good)
UI.color.fill= Green
else
UI.color.Fill = Red
}
为什么不只是绑定到'status'属性(或对变化事件作出反应)? –
这段代码没有做任何事情,比如你正在尝试做什么......你有没有使用过Timer或Background Worker等等。在Initialize之后,你调用'Checking()'你在调用Method之后使用了什么初始化..? – MethodMan