Alexandre Lemaire
Alexandre Lemaire

Reputation: 33

How WPF Converters are executed?

I'm facing render issues in very complex WPF UI which contains, among other things, a lot of Converters (IValueConverter, IMultiValueConverter).

I would like to know if the converters could be involved into this.

Does anyone known how WPF Converters worked ? Are they executed in parallel and then synchronized with the UI thread ? or is there some kind of foreach loop that treat every converter ?

Upvotes: 3

Views: 530

Answers (1)

brunnerh
brunnerh

Reputation: 184296

The converters are executed on the UI-thread, you can test this by blocking the thread using something like Thread.Sleep(10000). The UI is managed in a dispatcher queue, see the threading model reference for more information, updates to bindings are pushed into that queue. Converters are called if the binding was updated, they normally are not being called at the same time.

(Also see the good comments below)

Upvotes: 8

Related Questions