You need to add a call to ObserveOn()
. If you use nuget package Rx-Xaml you can leverage ObserveOnDispatcher():
this.Progress = Observable.Interval(ProgressInterval)
.ObserveOnDispatcher()
.Finally(terminate)
.Subscribe(notify);
See my answer here to understand the difference between ObserveOn
and SubscribeOn
. Also, you don't supply the code for PerformStep()
- I hope that it is fast and/or non-blocking.
I also replaced Timer
with Interval
as it saves you an argument.
Finally, presumably you are planning to dispose the subscription handle (this.Progress) when the job completes?