Why is only the UI thread allowed to modify the UI?

前端 未结 6 445
粉色の甜心
粉色の甜心 2020-11-28 11:59

I know that if I am modifying a control from a different thread, I should take care because WinForms and WPF don\'t allow modifying control\'s state from other threads.

6条回答
  •  被撕碎了的回忆
    2020-11-28 12:46

    .NET reserves the right to access your control in the thread where you created it at any time. Therefore accesses that come from another thread can never be thread safe.

提交回复
热议问题