우리는 WPF 프로젝트를 가지고 있습니다. 다음과 같은 오류가 발생했습니다 :C# WPF 프로젝트, InvalidOperationException을 방지하는 방법?
InvalidOperationException was unhandled
The calling thread cannot access this object because a different thread owns it.
저는 작곡가에서 만든 작업 스레드에서 TextBox 값을 얻으 려합니다.
어떻게 피하십시오. delegate
콜백 및 Invoked()
메서드를 사용하여 다른 Form 프로젝트에서이 문제를 피할 수 있었지만 어떻게 든이 WPF 프로젝트에서 작동하지 않습니다.
간단한 샘플 코드? 덕분에
또는 스레드 풀 스레드 - 그 텍스트 상자에서 텍스트를 취득하고자하는 경우 어떤 경우에, 그는 디스패처를해야하지만 ... 그것은 정말 아무튼 그가 쓰레기를 던지는 방법은 중요하지 않습니다. –
http://stackoverflow.com/questions/1247269/wpf-event-threading-gui-updating-question, http://stackoverflow.com/questions/1261248/wpf-thread-and-gui-how-to-access -object-from-different-thread, http://stackoverflow.com/questions/1792129/multithreaded-access-to-the-wpf-gui-in-c, http://stackoverflow.com/questions/1862590/how -to-update-gui-with-backgroundworker – Lazarus
스레드 ThreadPool에서 스레드 – 5YrsLaterDBA