private async void loadClickedBuilding(object sender, GestureEventArgs e)
{
if (isDownloading)
return;
removeSearchButton();
var img = (Image)sender;
var poi = img.DataContext as BuildingPoi;
var settings1 = IsolatedStorageFile.GetUserStoreForApplication();
if (settings1.DirectoryExists(poi.Buid) && checkCompleted(poi.Buid))
{
// load staff to the map
clear();
ReadAllBuildingFloorsFromIsolatedStorage(poi.Buid);
ReadPoisByBuildingFromIsolatedStorage(poi.Buid);
addBuildingsToMap(poi.Buid);
buildLoaded = true;
loadBuidingToMap(poi.Buid);
createAppBarMenuItem();
}
else
{
isDownloading = true;
//ApplicationBar.IsVisible = false;
//downloading.Visibility = Visibility.Visible;
loading.Visibility = Visibility.Visible;
loading.IsIndeterminate = true;
clear();
// download staff and show them to the map
var fsdf = await DownloadPoisBuildStaff(poi.Buid);
ReadAllBuildingFloorsFromIsolatedStorage(poi.Buid);
ReadPoisByBuildingFromIsolatedStorage(poi.Buid);
addBuildingsToMap(poi.Buid);
buildLoaded = true;
loadBuidingToMap(poi.Buid);
loading.Visibility = Visibility.Collapsed;
loading.IsIndeterminate = false;
createAppBarMenuItem();
isDownloading = false;
}
_searchBuilding = true;
}