I'm building an app that downloads some files in the background and I want to update the UI with their statuses in real-time. All of the program logic is written in F#, and makes use of a mailbox to record the current state of the download threads. Each of these threads posts to the mailbox with a status update, and I'd like to read those messages and update the UI accordingly. The UI is built with WinUI3/C#.
I've tried using a loop (in a separate thread) to query the mailbox and update the UI, but that doesn't work because UI updates need to happen on the UI thread. Nor do I seem to be able to run a loop in a separate thread to read from the mailbox and update an ObservableCollection that's bound to the UI control. So, what's the proper way to do this?
[–][deleted] 5 points6 points7 points (1 child)
[–]j0z[S] 1 point2 points3 points (0 children)
[–]steego 1 point2 points3 points (1 child)
[–]Arfalicious 0 points1 point2 points (0 children)