Reader small image

You're reading from  Learning Microsoft Cognitive Services

Product typeBook
Published inMar 2017
Reading LevelIntermediate
PublisherPackt
ISBN-139781786467843
Edition1st Edition
Languages
Right arrow
Author (1)
Leif Larsen
Leif Larsen
author image
Leif Larsen

Leif Larsen is a software engineer based in Norway. After earning a degree in computer engineering, he went on to work with the design and configuration of industrial control systems, for the most part, in the oil and gas industry. Over the last few years, he has worked as a developer, developing and maintaining geographical information systems, working with .NET technology. Today, he is working with a start-up, developing a brand new SaaS product. In his spare time, he develops mobile apps and explores new technologies to keep up with the high-paced tech world. You can find out more about him by checking out his blog, "Leif Larsen", and following him on Twitter (@leif_larsen) and LinkedIn (lhlarsen).
Read more about Leif Larsen

Right arrow

Helping the user with auto suggestions


Auto suggestions are a great way to enhance the user experience. The typical use case is where, whenever a user enters some text into a text field, a list of suggested words is displayed.

Note

If you have not already done so, sign up for the Bing Autosuggest API at https://www.microsoft.com/cognitive-services/en-us/bing-autosuggest-api.

Adding Autosuggest to the user interface

As textboxes in WPF do not contain any auto-suggestion features, we need to add some on our own. We are going to use a third-party package, so install the WPFTextBoxAutoComplete package through the NuGet package manager, in our example project.

In the MainView.xaml file, add the following attribute to the starting Window tag:

    xmlns:behaviors="clr-namespace: WPFTextBoxAutoComplete; assembly=WPFTextBoxAutoComplete" 

We will also need to make sure that the TextBox binding for our search query updates whenever the user enters data. This can be done by making sure the Text attribute...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Learning Microsoft Cognitive Services
Published in: Mar 2017Publisher: PacktISBN-13: 9781786467843

Author (1)

author image
Leif Larsen

Leif Larsen is a software engineer based in Norway. After earning a degree in computer engineering, he went on to work with the design and configuration of industrial control systems, for the most part, in the oil and gas industry. Over the last few years, he has worked as a developer, developing and maintaining geographical information systems, working with .NET technology. Today, he is working with a start-up, developing a brand new SaaS product. In his spare time, he develops mobile apps and explores new technologies to keep up with the high-paced tech world. You can find out more about him by checking out his blog, "Leif Larsen", and following him on Twitter (@leif_larsen) and LinkedIn (lhlarsen).
Read more about Leif Larsen