【发布时间】:2013-12-11 09:41:21
【问题描述】:
我需要等待事件完成才能继续。
这是我的代码:
foreach (KeyValuePair<string, Stream> pair in this.XMLCollection)
{
...
this.eventAggregator.GetEvent<LogToApplicationEvent>().Publish(credentials);
//wait
...
}
在继续之前,我需要等待“登录”事件完全执行。
我尝试使用Task.Factory,但它对我不起作用,或者我无法正确使用它...
此代码在 Presenter 上,但该事件会更新主 UI。
//publish
public virtual void Publish(TPayload payload)
{
base.InternalPublish(payload);
}
【问题讨论】:
-
Publish的签名是什么?
标签: c# .net wpf multithreading