Created
May 27, 2012 12:48
-
-
Save pinzolo/2814091 to your computer and use it in GitHub Desktop.
WPF再描画のためのDoEventsメソッド
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Windows.Threading; | |
/// <summary> | |
/// 現在メッセージ待ち行列の中にある全てのUIメッセージを処理します。 | |
/// </summary> | |
private void DoEvents() | |
{ | |
DispatcherFrame frame = new DispatcherFrame(); | |
var callback = new DispatcherOperationCallback(obj => | |
{ | |
((DispatcherFrame)obj).Continue = false; | |
return null; | |
}); | |
Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Background, callback, frame); | |
Dispatcher.PushFrame(frame); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment