Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Dispatcher Priority

$
0
0

Hi, in .NET 4.0 WPF app, I have to force refresh a label status in between database queries.

(update label, run a sql query, update lable, run a sql query, ...)

private delegate void MyDelegate();

private static void Refresh(DependencyObject obj)
{
    obj.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Loaded, (MyDelegate)delegate { });
}

While the documentation says that 'Loaded' has higher priority than 'ApplicationIdle', I noticed that setting to 'ApplicationIdle' force refreshes more consistently than 'Loaded' or 'Render'

Why?

http://msdn.microsoft.com/en-us/library/system.windows.threading.dispatcherpriority%28v=vs.110%29.aspx

Thanks,

-srinivas y.


sri



Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>