I have an INotifyPropertyChanged object, Foo. I turn Foo into an observable stream of events using Rx's FromEvent method:
var myFoo = new Foo();
var eventStream = Observable.FromEvent<PropertyChangedEventArgs>(myFoo, "PropertyChanged");
Now I want to listen for a particular property changed, and if .Progress == 100, unsubscribe:
eventStream
.Where(e => myFoo.Progress == 100)
.Subscribe(OnFooFinished);
How can I unsubscribe when Progress == 100? If I add a .Take(1) call after the .Where clause, would that automatically unsubscribe?