protected override async void OnCreate(Bundle savedInstanceState) { AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; base.OnCreate(savedInstanceState); // Create your application here // Set the current instance of TodoActivity. SetContentView(Android.Resource.Layout.CustomerOffers); instance = this; try { this.OffersTable = CurrentClient.GetTable <Entities.Offer>(); var offersList = await this.OffersTable.ToListAsync(); lstOffers = FindViewById <ListView>(Android.Resource.Id.lstOffers); ObservableCollection <Offer> data = new ObservableCollection <Offer>(offersList); data.CollectionChanged += Data_CollectionChanged; adapter = new CustomerOfferListAdapter(this, Android.Resource.Layout.CustomerOfferRow, data); lstOffers.Adapter = adapter; adapter.SetNotifyOnChange(true); adapter.NotifyDataSetChanged(); } catch (Microsoft.WindowsAzure.MobileServices.MobileServiceInvalidOperationException iEx) { var response = iEx.Response; var exceptionContent = await response.Content.ReadAsStringAsync(); } catch (Exception ex) { } ConfigurePushNotifications(); }
private ItemManager() { this.CurrentClient = new MobileServiceClient(@"https://xamarinchampions.azurewebsites.net/"); this._todoTable = CurrentClient.GetTable <TorneoItem>(); }