Silverlight Data Binding Prerequisites (Compact 7)
3/12/2014
If you are familiar with Windows Embedded Compact 7, Microsoft Silverlight for Windows Embedded, and Microsoft Expression Blend 3, and your application must display data that is maintained separately from the UI, you can use Silverlight for Windows Embedded classes and interfaces to bind data in a data collection to elements in the UI. When the data changes, you can update the data in the collection so that the UI can display the updated data.
The primary components that you use to implement data binding functionality include:
- A data source collection. An object that contains a set of C++ data source objects, which store strings, property values, or other nested objects in a property bag.
- The data provider. The external source of dynamic data, such as a server, database, or computer.
When the data provider has new data, you can design your application to access the data source collection, and update, delete, or add new objects to it. Then, the UI elements can display updated data stored in the collection.
In some cases, you may want to display hierarchical data in a Silverlight for Windows Embedded UI. When hierarchical data is supported in a data source collection, items in the collection can also contain their own sub-collections of data. For example, consider an application that displays a collection of inventory items. When a user selects an item, the user might also want to see a collection of calendar dates that shows when the item was produced, inspected, shipped, and purchased. To display a collection that belongs to an item in a collection, you must support hierarchical data in your Expression Blend project and C++ code.
The data-binding implementation for using data collections in Silverlight for Windows Embedded resembles the implementation in Microsoft Silverlight 3, but differs in the following respects:
- Silverlight for Windows Embedded provides one primary derived collection class, XRObservableCollection<ItemType>, which you use to create data source collections. In contrast, Microsoft Silverlight 3 provides approximately fourteen classes that inherit from System.Collections.ObjectModel::Collection<T>.
- Silverlight for Windows Embedded does not support reflection, but instead provides a property bag interface that handles the functionality of resolving property names.
- Silverlight for Windows Embedded provides helper classes to support functionality that resembles the Component Object Model (COM) for managing collection objects.
- Silverlight for Windows Embedded supports interface maps for extending data binding objects to support additional interfaces.
Before beginning the steps to populate the UI with collections of data, it is helpful to understand how data binding works in Silverlight for Windows Embedded. The next section provides in-depth information about how data binding works with data source collections.
Prerequisites
To populate a Silverlight for Windows Embedded UI with dynamic collections of data by following the steps in this section, you must install the following items on your computer in the order listed:
Microsoft Expression Blend 3. For more information, see Microsoft Expression Blend 3 at the Microsoft Download Center.
Visual Studio 2008 with SP1.
Windows Embedded Compact 7.
Important
By default, Windows Embedded Silverlight Tools is installed when you install Windows Embedded Compact 7. To verify this during installation, select Custom Install and confirm that the Windows Embedded Silverlight Tools option is selected.
A virtual CEPC, correctly installed and configured. For more information, see Develop with Virtual CEPC.
When you install Windows Embedded Silverlight Tools, the Expression Blend templates are installed at %ProgramFiles%\Microsoft Expression\Blend 3\ProjectTemplates\en\Windows Embedded Silverlight Tools\Application.
If you are using a non-U.S. English version of Expression Blend 3, you must manually copy the template files from %ProgramFiles%\Microsoft Expression\Blend 3\ProjectTemplates\en\Windows Embedded Silverlight Tools\Application to an Applications folder that you create in the local user directory at the following location: %Users%\user-name\Documents\Expression\Blend 3\ProjectTemplates\Windows Embedded Silverlight Tools\Applications.
After you manually copy the files to the new directory path, Expression Blend can display the templates in the New Project dialog box.
In addition, we recommend the following:
- (Optional) Determine which data provider (for example, a Microsoft Exchange Server, a VOD server, or a user’s media library of songs) that you want to use to populate the UI with data. Make sure that you can access the data; for example, by creating an Ethernet network connection to a test server, or by implementing the media library in your OS design project.
- Build a run-time image that supports Silverlight for Windows Embedded (using SYSGEN variable SYSGEN_XAMLRUNTIME), Target Control Shell (using SYSGEN variable SYSGEN_SHELL), and the functionality that your data provider requires. For example, if your data provider is a media library, the run-time image must support Media Library (using SYSGEN variable SYSGEN_MEDIAAPPS_MEDIALIBRARY).
See Also
Concepts
Populate a Silverlight for Windows Embedded UI with Collections of Data