WPF multi-thread UI is not thread-safe
- Dominant language
- C#
- Stars
- 7.7k
- Forks
- 1.3k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 61
Description
_This issue has been moved from [a ticket on Developer Community](https://developercommunity.visualstudio.com/t/WPF-multi-thread-UI-is-not-thread-safe-/10531948)._
---
\[severity:It bothers me. A fix would be nice\]
Hello,
We have WPF project where there are a 3 UI windows, each one runs on its own UI thread.
On project startup, the threads are created and by the way the 3 windows are created in parallel.
We noticed that the method **InitializeComponent()** is not thread-safe and causes an exception in the method **CleanUpRequestedStreamList()** within the file **PakageParts.cs**
In the following screenshot, we see that **\_requestedStreams.Count = 1** so the variable **i** should start from **0** but its value is **1** which means another thread modified it.

Is there any possibility to support multi-threaded UI in Wpf?
Thanks!
---
### Original Comments
#### Feedback Bot on 12/4/2023, 07:18 AM:
(private comment, text removed)
---
### Original Solutions
(no solutions)
Contributor guide
Assessment
This issue has not been assessed yet.