我听说这个可以刷新UI,但为什么呢?Dispatcher
调用了这个空操作,就这样,没有调用InvalidateMeasure()
,它会触发UI重新测量、重新排列和重新渲染。在这里,哪里进行测量和排列的过程来更新/刷新
UI?
private static Action EmptyDelegate = delegate() { };
public static void Refresh(UIElement uiElement)
{
uiElement.Dispatcher.Invoke(DispatcherPriority.Render, EmptyDelegate);
}
需要帮忙吗?
编辑:
我想知道为什么会渲染UI的详细信息。像“这将触发UI更新”这样的答案并没有给我帮助。