Base Controls for Windows Phone
March 22, 2012
This section lists both the supported and unsupported Silverlight controls for Windows Phone. These controls derive from either the System.Windows.Controls namespace in the .NET Framework Class Library for Silverlight or the Microsoft.Phone.Controls namespace in Windows Phone. Also listed in this section is the set of additional controls that is available from the Silverlight for Windows Phone Toolkit.
The following Silverlight controls are supported in Windows Phone and are included in the System.Windows.Controls Namespace in the .NET Framework Class Library for Silverlight.
|
Visual representation |
Description |
|
Border Draws a border, background, or both around another object. The example here shows a black border with rounded corners. For more information about this control, see Border |
|
Button When you click a Button, it raises the Click event. The example here shows a button with the text “Button”. For more information about this control, see Button |
|
Canvas A Canvas is one of the Panel elements that enable layout. Each child object is rendered within the Canvas area. You control the positioning of objects inside the Canvas by specifying x and y coordinates. These coordinates are in pixels. The x and y coordinates are often specified by using the Canvas.Left and Canvas.Top attached properties. The example here shows a canvas with a black background and a white rectangle contained within the canvas. For more information about this control, see Canvas |
|
CheckBox Represents a control that a user can select (check) or clear (uncheck). The example here shows a checkbox with the label checkbox item in the checked state. Clicking the checkbox would uncheck the checkbox and fire the Unchecked event. For more information about this control, see CheckBox. |
|
No Visual Representation |
ContentControl Represents a control with a single piece of content. For more information about this control, see ContentControl |
|
No Visual Representation |
ContentPresenter Displays the content of a ContentPresenter. For more information about this control, see ContentPresenter |
|
No Visual Representation |
Control Represents the base class for UI elements that use a ControlTemplate to define their appearance. For more information about this control, see Control |
|
Grid Defines a flexible grid area that consists of columns and rows. The example here shows a grid that has three rows and two columns. Each cell in the grid contains a TextBlock control whose text displays the row and column coordinates of the cell. The gridlines shown here are displayed by setting ShowGridlines = true for the grid. For more information about this control, see Grid |
|
HyperlinkButton Represents a button control that displays a hyperlink. The example here shows a HyperLinkButton with the text “Click Me!”. For more information about this control, see HyperlinkButton |
|
Image Represents a control that displays an image in the JPEG or PNG file format. The example here shows an image that has been rendered by this control. For more information about this control, see Image |
|
InkPresenter Implements a rectangular surface that displays ink strokes. The example here shows some hand-drawn ink strokes drawn on the control. For more information about this control, see InkPresenter |
|
ListBox Contains a list of selectable items. The example here shows a ListBox with three items labeled “item 0”, “item 1”, “item 2”. For more information about this control, see ListBox |
|
No Visual Representation |
MediaElement Represents an object that contains audio, video, or both. For more information about this control, see MediaElement |
|
MessageBox Displays a message to the user and optionally prompts for a response. The MessageBox control is part of the System.Windows namespace. It is added here for convenience and because it is an important user interface element. For more information about this control, see MessageBox |
|
No Visual Representation |
MultiScaleImage Enables users to open a multi-resolution image, which can be zoomed in on and panned across. For more information about this control, see MultiScaleImage |
|
No Visual Representation |
Panel Provides a base class for all Panel elements. Use Panel elements to position and arrange child objects in Silverlight-based applications For more information about this control, see Panel |
|
PasswordBox Represents a control for entering passwords. The example here shows text entered in the PasswordBox and displayed as password characters, obscuring what was entered. For more information about this control, see PasswordBox |
|
ProgressBar Represents a control that indicates the progress of an operation. The example here shows a ProgressBar with IsIndeterminate = true, which reports generic progress with a repeating pattern. For more information about this control, see ProgressBar |
|
RadioButton Represents a button that allows a user to select a single option from a group of options. This example shows two RadioButton controls titled “option 0” and “option 1” with the second option selected. For more information about this control, see RadioButton |
|
RichTextBox Represents a rich text editing control that supports formatted text, hyperlinks, inline images, and other rich content. For more information about this control, see RichTextBox |
|
No Visual Representation |
ScrollViewer Represents a scrollable area that can contain other visible elements. For more information about this control, see ScrollViewer |
|
Slider Represents a control that lets the user select from a range of values by moving a Thumb control along a track. This example shows a Slider control with a value set. For more information about this control, see Slider |
|
StackPanel Arranges child elements into a single line that can be oriented horizontally or vertically. The example here shows two RadioButton controls contained within a StackPanel. The StackPanel default orientation, shown here, is vertical. Children can also be stacked horizontally. For more information about this control, see StackPanel |
|
TextBlock Provides a lightweight control for displaying small amounts of text. The example here shows a line of text. For more information about this control, see TextBlock |
|
TextBox Represents a control that can be used to display single-format, multi-line text. The example here shows multiple lines of generic text. For more information about this control, see TextBox |
|
No Visual Representation |
UserControl Provides the base class for defining a new control that encapsulates related existing controls and provides its own logic. For more information about this control, see UserControl |
Note:
|
|---|
|
Microsoft UI Automation can be used to provide the basis for a testing automation framework. The namespace System.Windows.Automation.Peers is available on Windows Phone. This namespace is identical to the System.Windows.Automation.Peers namespace in the .NET Framework Class Library for Silverlight. For more information, including implementation specifics, see System.Automation.Peers Namespace. For more information about unit testing using automation peers, search MSDN for "Silverlight Unit Testing Framework." |
The following controls are supported in Windows Phone and are included in the Microsoft.Phone.Controls namespace. They will be discussed further in the following topics:
Silverlight for Windows Phone Toolkit offers developers additional controls for Windows Phone application development, designed to match the rich user experience of the Windows Phone. For more information, and to download this toolkit, see Silverlight for Windows Phone Toolkit
|
AutoCompleteBox |
ContextMenu |
DatePicker |
Gestures |
ListPicker |
LongListSelector |
|
PerformanceProgressBar |
TiltEffect |
TimePicker |
ToggleSwitch |
Page Transitions |
WrapPanel |
The following Silverlight controls are not supported in Windows Phone:
|
ComboBox |
TreeView |
OpenFileDialog |
SaveFileDialog |
ToolTip |
|
Calendar |
DataGrid |
DatePicker |
Frame – use PhoneApplicationFrame class. |
Page – use PhoneApplicationPage class. |
|
GridSplitter |
Label |
ScrollBar |
TabControl |
For the unsupported controls above, note the following:
-
A DatePicker control is available in the Silverlight for Windows Phone Toolkit as described above.
-
The ComboBox, ScrollBar, and ToolTip are hidden from the toolbox, but they can still be used in your application. The ComboBox is not themed to the Windows Phone design and you must modify it accordingly to maintain UI consistency. The ScrollBar and ToolTip are not suitable controls to use in a touch-based system.
-
The open and save file dialogs are not supported. You will have to use isolated storage in your application.
-
The Calendar, DataGrid, GridSplitter, TabControl, Label, and TreeView controls are from the Silverlight 3.0 platform and cannot be used. You must create your own version of these controls and theme accordingly to the Windows Phone design.
Note: