Learn WPF Using Google Place API8 min read


In this article, we will learn WPF using Google Place API with the WPF control web browser in Visual Studio 2015.

In this article, we are going to:

  • Create a WPF Application.
  • Using Google Place API.
  • Configure the API.

Create a WPF Application

Open Visual Studio 2015


Select the File menu >New > Click Project.

Select Windows templates, and choose the WPF Application. Then click “ok “after filling in the name and location.

After you complete the solution explorer, it will load basic bundles.

Open the ManiWindow.xaml file and Change it from <Grid> to <DockPanel>. It will load based on resolution.

Then drag a web browser from the Toolbox to the Designer window.

Adding some extra controls to get a result.

Using Google Place API

If you’re going to use Google API, you must sign up for a Gmail account. Once you successfully login click here. In this site, you have to click the “GET a Key” button to flow through a process where you will:

  • Create or select a project.
  • Enable the API.
  • Get an API Key.

Create and Enable the API

Create a project name and click the “CREATE AND ENABLE API.”

Get an API Key

In this process, you are getting keys ready to use in your application, so copy the key and click the “FINISH” Button.

Configure the API

I have checked this key using the URL below, and found out what the actual result is.


I have configured the URI and Key in APP.CONFIG.

Code Behind

First, I have initiated the URL for a web browser.

Create the new class for retrieving and storing the values.

Output 1


Then I get data from App.config.

Here, I have used the web URL to look for the UI and API URL and used it to get the values of this search’s result. Once you click the “Calculate” button, follow the below code.

I have added the distance mode in the API URL, as follows:


But, per our users’ needs, we can get the result from Google Place API.

After the calculation, I will navigate the Web URL to the web browser.

Run the application or Click (F5)

Output 2



In this article, we have learned WPF, using the Google Place API. If you have any queries, please tell me through the comments section. Your comments are very valuable.

Happy Coding!

Leave a Reply

Your email address will not be published. Required fields are marked *