tnw
tnw

Reputation: 13877

WPF Progress bar update as list of items run

I would like some help implementing a progress bar in my WPF application (MVVM).

My MainWindow has a button that runs this method:

private void AnalysisClick(object sender, RoutedEventArgs e)
{
    model.RunAnalysis();
}

My model runs a list of items thru a separate engine class:

foreach(List<Item> item in items)
    allItemResults.Add(engine.RunItem(item));

The RunItem method will then run that item.

My question is: How can I have each item update a ProgressBar in my MainWindow as it finishes?

EDIT: This is .NET 3.5

Upvotes: 2

Views: 427

Answers (1)

Bathineni
Bathineni

Reputation: 3496

have a look at the following blog.. you can easily achieve this using the sample code...

http://bathinenivenkatesh.blogspot.co.uk/2011/07/wpf-build-more-responsive-ui.html

Upvotes: 2

Related Questions