【发布时间】:2013-11-05 03:54:33
【问题描述】:
我在 WPF 中启动了两个背靠背进程,中间有一个 UI 更改。还有一个包含所有内容的while循环。所以,代码看起来像这样:
while(stackpanel.Children.Count != 0)
{
Grid grid = stackpanel.Children[0] as Grid;
// start process 1 and WaitForExit()
stackpanel.Remove(grid);
// start process 2 and WaitForExit()
}
问题在于,在第一个进程存在之后,第二个进程开始之前,UI 没有更新。它只在 while 循环终止时更新一次。
我怎样才能实现上述逻辑并能够重绘stackpanel?
【问题讨论】:
标签: wpf process waitforexit