コード例 #1
0
 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);
 }
コード例 #2
0
        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);
                }
            }));
        }
コード例 #3
0
 public IObservable <Change <TObject, TKey> > Watch(TKey key)
 {
     return(_cache.Watch(key));
 }