It seems that you are subscribing to what is observed in your searchScrip_TextChanged handler.
This means that the first time searchScrip_TextChanged receives an S call, it has already happened before you connected the observable. So, of course, it does not work.
But now, when S pressed, you have one subscription, so when E is dialed, you get one SE . But since the searchScrip_TextChanged handler searchScrip_TextChanged called for E too, you now have two subscriptions to your observable.
So, when A is typed, you get two SEA because you have two observables. But again, searchScrip_TextChanged is called for A , so now you have three observables.
Etc etc. etc.
Events do not end automatically. You need to manually get rid of the subscription so that they end. This should make sense because this is what you do with regular event handlers that you want to stop.
You must create your observable when your form is loaded so that it will be created once.
It should look like this:
IObservable<string> textChangedObservable = Observable.FromEventPattern<TextChangedEventArgs>(searchScrip, "TextChanged") .Select(evt => searchScrip.Text); IDisposable subscription = textChangedObservable .Subscribe( s => Debug.Print("OnNext " + s + "\n"), s => Debug.Print("OnCompleted\n"));
source share