private void SetupUiUtilities() { _observableHelper = new ObservableHelper(); _uiThreadInvoker = new UiThreadInvoker(_logger); _uiStateController = new UiStateController(_logger, new UiLockerContextFactory()); var asyncCommandWatcherFactory = new AsyncCommandWatcherFactory(_uiStateController); _notifyTaskCompletionFactory = new NotifyTaskCompletionFactory(_logger); _asyncCommandFactory = new AsyncCommandFactory(_notifyTaskCompletionFactory, asyncCommandWatcherFactory, new TaskWrapper()); _asyncCommandAdaptorFactory = new AsyncCommandAdaptorFactory(_asyncCommandFactory); }
public Form1() { InitializeComponent(); _repo = new ObservableHelper<Customer>(); //SearchList("");//load all ControlScheduler cs = new ControlScheduler(this);//WE NEED THIS. Observable.FromEventPattern(h => textBox1.TextChanged += h, h => textBox1.TextChanged -= h)//tell Rx about our event .Throttle(TimeSpan.FromMilliseconds(500), cs)///throttle .Do(a => SearchList(textBox1.Text))//do this method .Subscribe();//this is where we tell it to begin all the magic }