【发布时间】:2017-12-21 02:47:55
【问题描述】:
我想从线程内部调用Update(int i)。我曾经使用BeginInvoke(),但在UWP中不可用。
public class Viewmodel
{
Viewmodel()
{
//start task
var mainTask = Task.Factory.StartNew(() =>
{
MyThread();
});
}
private void MyThread()
{
int i;
while(condition)
{
//do somethings
Update(i)
}
}
private Update(int i)
{
//do somethings
}
}
【问题讨论】:
标签: c# multithreading uwp task