private async void Locator_PositionChanged(object sender, PositionEventArgs e) { MoveMap(e.Position); var advertisements = await AdvertisementLogic.GetAdvertisements(currentPosition.Latitude, currentPosition.Longitude); DisplayInMap(advertisements); }
protected override async void OnAppearing() { base.OnAppearing(); using (SQLiteConnection conn = new SQLiteConnection(App.DatabaseLocation)) { conn.CreateTable <Advertisement>(); var advertisements = conn.Table <Advertisement>().ToList(); if (advertisements.Count > 0) { postListView.ItemsSource = advertisements; } else { advertisements = await AdvertisementLogic.GetAdvertisements(App.LoginUserNumber); postListView.ItemsSource = advertisements; } } }