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();
}
}
'Dev::DotNet > WPF' 카테고리의 다른 글
| ComboBox 의 SelectedValue 와 SelectedItem 의 성능적 차이 (0) | 2013.11.29 |
|---|---|
| XmlnsDefinition 을 통한 namespace 매칭 (0) | 2013.11.22 |
| WPF Visual Tree or Logical Tree 순회 (0) | 2013.11.13 |
| NetAdvantage XamDockManager 의 Splitter 고정 (0) | 2013.11.08 |
| WPF Filter ComboBox (0) | 2013.11.04 |