Example
private void Start(object sender, RoutedEventArgs e)
{
int progress = 0;
for (;;)
{
System.Threading.Thread.Sleep(1);
progress++;
Logger.Info(progress);
}
}
What is the recommended approach (TAP or TPL or BackgroundWorker or Dispatcher or others) if I want Start()
to
- not block the UI thread
- provide progress reporting
- be cancelable
- support multithreading
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…