private void SelectWhenLoaded(string id) { //put the code onto the main thread so it happens after binding _autoSelector.Disposable = _transformedCache.Watch(id) .ObserveOn(_schedulerProvider.MainThread) .Subscribe(change => SelectedItem = change.Current); }
public static IObservable <bool> WatchBoolean <TValue, TKey>(this IObservableCache <TValue, TKey> cache, TKey key, Func <TValue, bool> func) { return(cache.Watch(key).Scan(false, (state, change) => { switch (change.Reason) { case ChangeReason.Remove: return false; default: return func(change.Current); } })); }
public IObservable <Change <TObject, TKey> > Watch(TKey key) { return(_cache.Watch(key)); }