0

Today I started with my WPF training and one of the points that came up was that it requires to run with STAThread attribute. I read Why does WPF require a STAThread attribute to be applied to the Main method? question and I understood the difference between STA and MTA models. Our trainer mentioned that because WPF uses DirectX that is why STA is required. However, he did not elaborate on that.

I am trying to get more information on this. But I still do not understand why is STA required and is there a dependency on DirectX because of which STA model is adapted? Or what kind of synchronizing issues occured in Windows UI development which lead to development of this model?

Please help me with this topic. Also, any links or articles which I can read further to understand this concept.

Thanks.

Community
  • 1
  • 1
Piyush Parashar
  • 866
  • 8
  • 20
  • 3
    See [here](http://msdn.microsoft.com/en-us/library/ms750441.aspx#System_Threading_DispatcherObject): `... The primary reason for this was interoperability – systems like OLE 2.0, the clipboard, and Internet Explorer all require single thread affinity (STA) execution. ...` – Clemens Nov 24 '14 at 17:09
  • Thanks for this. While I understand the compatibility perspective I also wanted to know how does STA helps in UI development or what is its significance? Do you have any idea about that? – Piyush Parashar Nov 25 '14 at 04:55

0 Answers0