コード例 #1
0
        private async void btnSearch_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            sResult = await Geography.Search(tbSearch.Text);

            if (sResult.status == "OK")
            {
                lvList.Items.Clear();

                foreach (var r in sResult.results)
                {
                    var postal = r.FromType("postal_code");
                    var county = r.FromType("country");

                    lvList.Items.Add(new GeolocationItem()
                    {
                        RawData = r,

                        Address = r.formatted_address
                                  .Replace(county.long_name, "")
                                  .Trim(),
                        Postal = postal.long_name
                    });
                }
            }
        }