WPF加速UI进程

时间:2021-01-26 15:32:05   收藏:0   阅读:18

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);
    }
}

原文:https://www.cnblogs.com/ives/p/14329914.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!