1

I have a property that takes a long time to load (it creates a thumbnail). When I use the IsAsync binding property it throws the error "The calling thread must be STA, because many UI components require this." How can I fix this?

Manuel
  • 10,869
  • 14
  • 55
  • 86
  • This question should answer your question: http://stackoverflow.com/questions/2329978/the-calling-thread-must-be-sta-because-many-ui-components-require-this – Avada Kedavra Aug 20 '12 at 22:20
  • This may also shed some light: http://stackoverflow.com/questions/4183622/the-calling-thread-must-be-sta-because-many-ui-components-require-this-in-wpf – Avada Kedavra Aug 20 '12 at 22:22
  • Not really. They don't mention the IsAsync property that I'm using. In those threads they're doing the threading manually. Here it's WPF the one doing it. – Manuel Aug 20 '12 at 22:36
  • Can you show us the logic behind the property you're binding to? If you set `IsAsync=true` then you need your code to support this. It's going to throw that operation into a background worker and if any of your code modifies elements that operate on the UI thread, then you're going to have issues. – erodewald Oct 15 '12 at 19:08

0 Answers0