In WPF Window update UI code look like the follwoing:
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
Observable.Interval(TimeSpan.FromSeconds(1)).ObserveOn(Dispatcher).Subscribe((i) => this.Title = i.ToString());
}
}
or
Observable.Interval(TimeSpan.FromSeconds(1)).ObserveOn(this).Subscribe((i) => this.Title = i.ToString());
ObserveOn = Notify Observer on a Dispatcher
SubscribeOn = Subscribe/unsubscribe Observers on a scheduler, where background/task pool will run.
Sunday, October 19, 2014
Rx ObserveOn SubscribeOn
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment