0
点赞
收藏
分享

微信扫一扫

WPF加速UI进程

ITWYY 2022-07-28 阅读 71

public static class WindowEx

{

public static void DoEvents(this Window obj)

{

DispatcherFrame frame = new DispatcherFrame();

Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Background,

new DispatcherOperationCallback(delegate (object f)

{

((DispatcherFrame)f).Continue = false;

                return null;
}
), frame);
Dispatcher.PushFrame(frame);
}
}


举报

相关推荐

0 条评论