private async void OnRefreshClick(object sender, RoutedEventArgs e)
        {
            var loader = new EntityLoader();
            this.GlobalAppBar.IsOpen = false;

            var result = await loader.LoadAsync();
            if (!result)
            {
                this.Map.IsEnabled = false;
            }

            this.itemGridView.SelectedItem = null;
        }
Пример #2
0
 private static void OnApplicationSettingsChanged(object sender, PropertyChangedEventArgs args)
 {
     if (args.PropertyName.Equals("ItemsToShow"))
     {
         var loader = new EntityLoader();
         loader.LoadAsync();
     }
 }
Пример #3
0
 private async Task<bool> RefreshData()
 {
     var loader = new EntityLoader();
     return await loader.LoadAsync();
 }
        private async void OnResultsGridViewItemClicked(object sender, ItemClickEventArgs args)
        {
            var item = args.ClickedItem as SearchMatch;
            if (item == null)
            {
                return;
            }

            var loader = new EntityLoader();
            var response = await loader.LoadByCoordinatesAsync(item.Latitude, item.Longitude, Convert.ToInt32(ApplicationSettings.Instance.ItemsToShow) / 3);

            if (response == null)
            {
                var dialog =
                        new MessageDialog(
                                "Failed to load ATMs nearby from online services. It could be that services are down and we definitely are working on it.",
                                "Oops!");
                await dialog.ShowAsync();
                return;
            }

            var searchGroup = new EntityDataGroup("search", "Search Results", string.Empty, null, string.Empty);
            response.NearbyCashOutMachines.ForEach(e => searchGroup.Items.Add(e.ConvertToDataItem(searchGroup)));

            Frame.Navigate(
                           typeof(MapPage), 
                           new MapPageParameters
                               {
                                       ShowSearchResults = true, 
                                       SearchMatchLatitude = item.Latitude, 
                                       SearchMatchLongitude = item.Longitude,
                                       ShowGroup = searchGroup
                               });
        }