I got this technique from this link:
http://windowsclient.net/learn/video.aspx?v=57027
Its related to using the BackgroundWorker, apparently BackgroundWorker calles Dispatcher, but this example is so simple that I like it.
private void DoSomething()
{
new Thread(
delegate()
{
Dispatcher.BeginInvoke(DispatcherPriority.Background, (SendOrPostCallback)delegate { progressBar.IsIndeterminate = true; }, null);
LongRunningProcess();
Dispatcher.BeginInvoke(DispatcherPriority.Background, (SendOrPostCallback)delegate { progressBar.IsIndeterminate = false; }, null);
}
).Start();
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment