IT tutorials
 
Mobile
 

Windows Phone 8 : Windows Phone Toolkit (part 1) - AutoCompleteBox Control

6/23/2013 7:45:22 PM
- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019

In addition to the controls that are part of the Windows Phone SDK, there is another download called the Windows Phone Toolkit. The version of the Toolkit for the phone includes a set of controls specific to the phone to help you create compelling applications. You should install the Windows Phone Toolkit to add these controls to your applications. You can download the Windows Phone Toolkit directly from the CodePlex site at http://phone.codeplex.com. You can download only the installer, or you can opt to download the source code and other assets if you’re interested in how these controls have been built. The entire project is open source.

The Windows Phone Toolkit includes the following controls:

AutoCompleteBox

ContextMenu

DatePicker

TimePicker

ListPicker

LongListSelector2

2 This control is part of the phone controls in Windows Phone 7. It was moved from the Windows Phone Toolkit to the main Windows Phone runtime for Windows Phone 8.

ToggleSwitch

ExpanderView

PhoneTextBox

Rating

CustomMessageBox

WrapPanel

We will discuss these controls in the subsections that follow.

Before you can get started using the Windows Phone Toolkit, you will need to add it to your project. Visual Studio Express 2012 for the Windows Phone Developers includes built-in support for a package management system called NuGet. With NuGet you can easily add the Toolkit to your project by right-clicking the project and selecting “Manage NuGet Packages.” The dialog box that opens lets you add any of a number of Microsoft or community contributes packages to your project. Figure 1 shows how you can select the Online packages and simply search for “wptoolkit” to locate the Windows Phone Toolkit. Clicking the Install button will add it to your project.

Image

FIGURE 1 Using NuGet to add the Windows Phone Toolkit

1. AutoCompleteBox Control

First up is the AutoCompleteBox. The purpose of this control is to enable you to suggest selections as a user types into the control. The control is styled to look just like the TextBox, but as the user types, the control can show a list of possible options. For example, in Figure 2 when the user types “S,” the control shows a pop-up with all options that start with the letter S.

Image

FIGURE 2 AutoCompleteBox example

The control is a list control, so you can assign an arbitrary list to the ItemsSource property:

theBox.ItemsSource = new string[]
{
  "Shawn",
  "Steve",
  "Sally",
  "Bob",
  "Kevin"
};

You can customize the control using XAML attributes in a number of ways, including specifying whether text completion is enabled and what type of filtering to support (StartsWith is the default, but you can have the suggestions based on Contains or Equals as well):

<toolkit:AutoCompleteBox x:Name="theBox"
                         IsTextCompletionEnabled="True"
                         FilterMode="Contains" />

A common approach with the AutoCompleteBox is to support a list of values that are not known at development time. This is how the Bing and Google search boxes work on the Web. You can achieve this by handling the TextChanged event and then filling in the ItemsSource as the text changes:

// Constructor
public MainPage()
{
  InitializeComponent();

  theBox.TextChanged += theBox_TextChanged;
}

void theBox_TextChanged(object sender, RoutedEventArgs e)
{
  // Go retrieve a list of items from a service
}

 
Others
 
- Android 3 : Employing Basic Widgets - Turn the Radio Up, It's Quite a View
- Android 3 : Employing Basic Widgets - Just Another Box to Check
- iTunes on Your iPad : Purchasing or Renting Music, Videos, Podcasts, and More
- iTunes on Your iPad : iTunes U – Great Educational Content, Searching iTunes
- iTunes on Your iPad : Finding Music with Featured, Top Charts, and Genius
- BlackBerry Java Application Development - Changing the perspective
- BlackBerry Java Application Development - Starting the debugger
- BlackBerry Java Application Development - Running an application in the simulator
- Windows Phone 7 : Silverlight User Interface Development - Designing for Windows Phone 7 (part 2) - Designer and Developer Mechanics
- Windows Phone 7 : Silverlight User Interface Development - Designing for Windows Phone 7 (part 1) - Design Approach, Design Resources
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
Technology FAQ
- Is possible to just to use a wireless router to extend wireless access to wireless access points?
- Ruby - Insert Struct to MySql
- how to find my Symantec pcAnywhere serial number
- About direct X / Open GL issue
- How to determine eclipse version?
- What SAN cert Exchange 2010 for UM, OA?
- How do I populate a SQL Express table from Excel file?
- code for express check out with Paypal.
- Problem with Templated User Control
- ShellExecute SW_HIDE
programming4us programming4us