I had to modify the code a bit to work in the LightSwitch (SilverLight 4) application with Rx v1.0.10621 due to some interface changes in Rx since this question was asked.
You must install Rx and reference the System.Reactive and System.Reactive.Windows.Threading assemblies (for LightSwitch, this link is in the Client project).
Then use this code to throttle the TextChange event in a text field:
(Note: For highlighting, this code is included in the ControlAvailable handler)
var textChangedEvent = Observable .FromEventPattern<TextChangedEventArgs>(e.Control, "TextChanged") .Throttle(TimeSpan.FromMilliseconds(500)) .ObserveOnDispatcher(); textChangedEvent.Subscribe(changed => { var tb = changed.Sender as TextBox; if (tb.Text.Length >= 3)
source share