WPF加速UI进程

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);
    }
}
留待后查,同时方便他人
联系我:renhanlinbsl@163.com
原文地址:https://www.cnblogs.com/ives/p/14329914.html