wpf调用外部线程操作ui方法

来源:互联网 发布:网易imap服务器和端口 编辑:程序博客网 时间:2024/05/21 19:44
private void PageLoad(object o)
{
_thisWindow
= oas Window;
Thread t
= new Thread(delegate()
{
_thisWindow.Dispatcher.Invoke(
new Action(delegate()
{
PageLoad();
}));
});
t.Start();
}

private void PageLoad()
{
this.SeletcedItem= "ok";
//do some thing...
}