Setting up a common core
Before we get into the details, we want to set ourselves up for success. At the time of writing, none of the language APIs that we will be covering have NuGet client packages. As such, we will need to call directly to the REST endpoints. Because of this, we will do some work beforehand to make sure that we get away with writing less code.
New project
We will not be adding the APIs to our smart-house application. Using the following steps, create a new project using the MVVM template that we created in Chapter 1, Getting Started with Microsoft Cognitive Services:
- Go into the NuGet package manager and install
Newtonsoft.Json
. This will help us deserialize API responses and serialize request bodies. - Right-click on References.
- In the Assemblies tab, select System.Web and System.Runtime.Serialization.
- Click OK.
- In the
MainView.xaml
file, add aTabControl
element. All our additional views will be added asTabItems
in theMainView
.
Web requests
All the APIs follow the same pattern...