/// <summary>
        /// OnResume
        /// </summary>
        protected async override void OnResume()
        {
            try
            {
                base.OnResume();
                // show the loading overlay on the UI thread
                progress = ProgressDialog.Show(this, "Loading", "Please Wait...", true);

                //listings = SQLLightCachingHelper.GetProperties().Result;
                propertylistings = await propertyManager.GetItemsAsync();

                // create our adapter
                listingAdapter = new PropertyListingsManagerAdapter(this,
                                                                    Resource.Layout.CustomLayoutListingView,
                                                                    propertylistings);

                propertylisttingsView = FindViewById <ListView>(Resource.Id.PropertylisttingsView);
                //Hook up our adapter to our ListView
                propertylisttingsView.Adapter = listingAdapter;
                if (CrossConnectivity.Current.IsConnected)
                {
                    SQLLiteHelper.InsertProperty(propertylistings);
                }

                if (progress != null)
                {
                    progress.Hide();
                }
            }
            catch
            {
            }
        }
示例#2
0
 public void TestGetItemsAsync()
 {
     Task.Run(async() =>
     {
         var list = await mgr.GetItemsAsync();
         Assert.IsTrue(list != null && list.Count > 0);
     }
              ).GetAwaiter().GetResult();
 }
示例#3
0
        public override void ViewWillAppear(bool animated)
        {
            base.ViewWillAppear(animated);


            properties = propertyManager.GetItemsAsync().Result;
            // bind every time, to reflect deletion in the Detail view
            TableView.Source = new PropertyTableSource(properties);
        }