Closed southernwind closed 2 months ago
You can find a minimal reproducible example in the following repository: https://github.com/southernwind/R3WinUITest
ReactiveProperty does not automatically assignment to UI Threads, so you must control it yourself.
The most commonly used is ObserveOn
,
For example
IncrementInTaskCommand./* Operators */.ObserveOnCurrentSynchronizationContext().Subscribe(x => { } )
would be written like this, and the inside of the Subscribe would be processed on the UI thread.
Thank you. This issue has been resolved.
I am encountering an issue in a WinUI 3 application where updating a ReactiveProperty that is bound to the UI using x:Bind from a non-UI thread results in a System.Runtime.InteropServices.COMException.
Steps to Reproduce:
Example Code:
Expected Behavior: The ReactiveProperty should be updated without causing any exceptions.
Actual Behavior: A System.Runtime.InteropServices.COMException is thrown when the ReactiveProperty is updated from a non-UI thread.
Any guidance on how to resolve this issue would be greatly appreciated. Thank you!