/// <summary> /// OnCreate /// </summary> /// <param name="savedInstanceState"></param> protected async override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); progress = ProgressDialog.Show(this, "Loading", "Please Wait...", true); //propertyManager = TinyIoC.TinyIoCContainer.Current.Resolve<IPropertyMangager>(); propertyManager = Mvx.GetSingleton <IPropertyMangager>(); // propertyManager = new PropertyMangager(); int listingID = Intent.GetIntExtra("ListingID", 0); if (listingID > 0) { propertydetail = await propertyManager.GetItemAsync(listingID.ToString()); } SetContentView(Resource.Layout.PropertyDetailView); if (propertydetail != null) { BindFields(); } if (CrossConnectivity.Current.IsConnected) { SQLLiteHelper.InsertPropertyDetails(propertydetail); } if (progress != null) { progress.Hide(); } }
/// <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 { } }