WPF MVVM 绑定模式下 界面刷新

public void DoEvents()
        {
            DispatcherFrame frame = new DispatcherFrame();
            Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Background,
                new DispatcherOperationCallback(delegate (object f)
                {
                    ((DispatcherFrame)f).Continue = false;
                    return null;
                }
            ), frame);
            Dispatcher.PushFrame(frame);
        }

跟Winform的Application.DoEvent(); 效果类似

你可能感兴趣的:(WPF)