AnyPlace.MainPage.loadClickedBuilding C# (CSharp) Method

loadClickedBuilding() private method

private loadClickedBuilding ( object sender, System.Windows.Input.GestureEventArgs e ) : void
sender object
e System.Windows.Input.GestureEventArgs
return void
        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;
        }
MainPage