Jordan
Jordan

Reputation: 9901

How can I get notified that binding has finished?

I have an application to which I want to add a progress bar. It works in most cases. In one case the time is actually taken because of binding and layout work which is asynchronous, so my progress bar is hidden before the work is actually done. Its rather large list of items shown within a scroll view. I can't use virtualizing because I need it to scroll smoothly as it is a touch screen application. So needless to say, it takes forever to bind and layout this list. Is there any way I can get notified that the binding and layout has finished?

I'm using Visual Studio 2010, but because of constraints I'm forced to use .Net 3.5.

Upvotes: 0

Views: 262

Answers (1)

Athari
Athari

Reputation: 34285

If you want to execute code when binding and rendering are completed, use this code.

Dispatcher.Invoke(new Action(() =>
    {
        // hide progress bar
    }), DispatcherPriority.Input);

Upvotes: 1

Related Questions