Dev::DotNet/WPF
WPF 에서 DoEvents
isfry
2013. 11. 18. 09:27
VB 도 Winform 도 이벤트를 일괄 처리하는 DoEvents 라는 걸 지원한다.
WPF 에서는 Dispatcher 에서 진행되지 않은 UI 작업을 일괄 처리함으로써 비슷한 효과를 낼 수 있다.
public static void DoEvents() { if (System.Windows.Application.Current != null) { // WPF System.Windows.Application.Current.Dispatcher.Invoke ( System.Windows.Threading.DispatcherPriority.Background, new Action(delegate { }) ); } else { // WinForm System.Windows.Forms.Application.DoEvents(); } }