【发布时间】:2023-04-04 00:17:01
【问题描述】:
我们正在使用 .NET 3.5 并已开始使用 Reactive Extensions。我们正在使用与 .NET 3.5 兼容的 system.Reactive(运行时版本:v2.0.50727)。
我正在尝试观察调度程序调度程序上的事件,因为我正在使用 WPF 控件(它是 winforms shell,嵌入了 WPF 主机控件),但是我无法在调度程序类上发现该选项(system.reactive.concurrency .调度程序)。看起来它可以从 .NET 4.0 开始使用。我的问题是,如何在 .NET 3.5 中使用它?请注意,调用发生在我的 ViewModel 内部,而不是 View。
代码:
this.ObservePropertyChanged(x => x.Queue)
//I cant find scheduler dispatcher option,
//there are other options such as current, imeediete, new etc.
.ObserveOn(Scheduler.Dispatcher)
.Subscribe(RefreshQueues);
谢谢,
-迈克
【问题讨论】:
标签: c# system.reactive