public async Task LoadCustomers() { try { // we're only loading 50 as the grid doesn't performance very well under load IsLoading = true; Customers.Clear(); // await //var customers = await services.GetAllCustomers(); //Customers.AddRange(customers.Take(50)); //IsLoading = false; // or rx #1 //var source = Observable.Create<IEnumerable<Customer>>( // async o => // { // var response = await services.GetAllCustomers(); // o.OnNext(response); // o.OnCompleted(); // return Disposable.Empty; // }); // or rx #2 var source = services.GetAllCustomers().ToObservable(); source .SubscribeOn(NewThreadScheduler.Default) .ObserveOnDispatcher() .Subscribe(customers => Customers.AddRange(customers.Take(50)), () => IsLoading = false); } catch (Exception ex) { logger.Log(ex.Message, Category.Exception, Priority.High); eventAggregator.GetEvent <ApplicationExceptionEvent>().Publish(ex.Message); IsLoading = false; ErrorMessage = ex.Message; } }