private void searchBox_SuggestionChosen(AutoSuggestBox sender, AutoSuggestBoxSuggestionChosenEventArgs args)
        {
            string tag = ((AutoSuggestBox)sender).Tag.ToString();

            var selected = args.SelectedItem as Result;

            LocationData location = new LocationData()
            {
                Position = new BasicGeoposition()
                {
                    Latitude = selected.position.lat, Longitude = selected.position.lon, Altitude = 50
                }
            };

            location.Name             = LocationHelper.ConstructStringFromAddress(selected.address, "name", null);
            location.Address          = LocationHelper.ConstructStringFromAddress(selected.address, "address", null);
            location.FormattedAddress = LocationHelper.ConstructStringFromAddress(selected.address, "full", null);

            if (String.IsNullOrWhiteSpace(location.Name))
            {
                location.Name = selected.position.lat.ToString("0.000000, ") + selected.position.lon.ToString("0.000000");
            }

            if (selected.poi != null)
            {
                location.Name = selected.poi.name;
            }

            EditNewLocation(location);

            if (tag == "main")
            {
                mainSearchBox.Text = string.Empty;
            }
            else
            {
                RouteWaypoints.Add(location);
                WayPointSearch.Text                   = string.Empty;
                AddRouteWayPointGrid.Visibility       = Visibility.Collapsed;
                AddRouteWayPointButtonGrid.Visibility = Visibility.Visible;
            }
        }
        /// <summary>
        /// Search nearby POIs based on selected category
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private async void SearchByCategory_Click(object sender, RoutedEventArgs e)
        {
            NearbyLocations.Clear();
            PinnedLocationListView.UpdateLayout();

            var selected         = (MenuFlyoutItem)sender;
            var selectedlocation = selected.DataContext as LocationData;
            var searchCategory   = selected.Text;
            var language         = (LanguageComboBox.SelectedItem as ComboBoxItem).Tag.ToString();

            var results = await LocationHelper.SearchPOIsByCategory(searchCategory, selectedlocation.Position, language, selectedlocation.CountryCode);

            foreach (var result in results)
            {
                LocationData location = new LocationData()
                {
                    Position = new BasicGeoposition()
                    {
                        Latitude = result.position.lat, Longitude = result.position.lon, Altitude = 50
                    }
                };

                location.Name             = LocationHelper.ConstructStringFromAddress(result.address, "name", null);
                location.Address          = LocationHelper.ConstructStringFromAddress(result.address, "address", null);
                location.FormattedAddress = LocationHelper.ConstructStringFromAddress(result.address, "full", null);

                if (String.IsNullOrWhiteSpace(location.Name))
                {
                    location.Name = result.position.lat.ToString("0.000000, ") + result.position.lon.ToString("0.000000");
                }

                if (result.poi != null)
                {
                    location.Name = result.poi.name;
                }

                NearbyLocations.Add(location);
            }
        }