Inheritance: IRandomAccessStream
Exemplo n.º 1
0
        public IObservable <BitmapImage> FetchImageForAlbum(Song song)
        {
            var rq = rqFactory(HttpMethod.Get, String.Format("images/art/{0}.png", song.id));

            return(client.RequestAsync(rq)
                   .SelectMany(x => x.Content.ReadAsByteArrayAsync())
                   .ObserveOn(RxApp.DeferredScheduler)
                   .SelectMany(x => {
                var ret = new BitmapImage();
                var mem = new MemoryRandomAccessStream(x);
                return ret.SetSourceAsync(mem).ToObservable().Select(_ => ret);
            }));
        }
Exemplo n.º 2
0
 public IObservable<BitmapImage> FetchImageForAlbum(Song song)
 {
     var rq = rqFactory(HttpMethod.Get, String.Format("images/art/{0}.png", song.id));
     return client.RequestAsync(rq)
         .SelectMany(x => x.Content.ReadAsByteArrayAsync())
         .ObserveOn(RxApp.DeferredScheduler)
         .SelectMany(x => {
                 var ret = new BitmapImage();
                 var mem = new MemoryRandomAccessStream(x);
                 return ret.SetSourceAsync(mem).ToObservable().Select(_ => ret);
         });
 }