Share via


Silverlight for Windows Embedded Application Development (Compact 7)

3/12/2014

Microsoft Silverlight for Windows Embedded is a "UI development framework" for "embedded devices" and is based on Microsoft Silverlight for the desktop browser. By using Silverlight for Windows Embedded, you can create an application that supports features such as storyboard animations, transformations, interactive controls, a layout system, and a visual tree.

Silverlight for Windows Embedded is a native C++ development framework in which you can design a UI for the shell and applications for a Windows Embedded Compact device. You can use Microsoft Expression Blend 3 to quickly design a UI in Extensible Application Markup Language (XAML), which you can then convert, or you can build your application from scratch in Microsoft Visual Studio 2008 by using one of the Smart Device project templates. In the native C++ source files for your application, you can use the rest of the features of Windows Embedded Compact 7, including any existing window controls.

By using Silverlight for Windows Embedded, you can create a UI that provides advanced visual effects for your Windows Embedded Compact device shell and applications. Silverlight for Windows Embedded makes this possible by supporting a subset of Silverlight XAML elements and by supplying a set of C++ classes that provide access to these elements.

Silverlight for Windows Embedded parses an XAML UI and loads it into a C++ object tree. It then integrates the C++ objects with the Graphics, Windowing, and Events (GWES) subsystem to provide a UI for Windows Embedded Compact devices.

The following picture shows a sample home screen that was developed by using Silverlight for Windows Embedded.

Sample Home Screen with Default Theme for Large Size Screens

Fig. 1: Sample Home screen, default theme, large

Features and Benefits of Silverlight for Windows Embedded Development Framework

The Silverlight for Windows Embedded development framework provides the following features and benefits:

  • Silverlight for Windows Embedded C++ API and a programming model that integrates with the Windows Embedded Compact operating system. This interoperability helps shorten the learning curve for developers who are familiar with programming in C++ for Windows Embedded Compact.
  • C++ classes that developers can use to create or customize the visual appearance and the behavior of UI elements.
  • Support for advanced UI features, including gradients, transformations, and animations, so that developers can create interactive Silverlight for Windows Embedded-based controls in UIs for embedded applications.
  • Compatibility with Silverlight XAML and a set of equivalent classes for supported XAML elements for developers and designers who are familiar with using Silverlight XAML.
  • Run-time support for displaying XAML UIs so that, if they prefer, OEMs can design UIs for applications that are entirely in XAML.
  • Ability to dynamically change the UI at run time by using C++.
  • Separation of programming logic and UI design to encourage XAML designers to focus on designing user experiences, and to help developers to focus on integration, programming logic, and run-time behavior.
  • Interoperability with Microsoft Expression Blend 3 XAML projects and Windows Embedded Silverlight Tools. You can use them together to generate template C++ project code that is based on an Expression Blend 3 XAML project.

Supported Silverlight UI Features

Silverlight for Windows Embedded introduces a subset of Silverlight features to embedded devices, including the following UI features:

  • Advanced Graphics. Graphics capabilities include brushes that produce gradient multicolor blend effects; image brushes that can paint the interior of UI elements, and; transforms, which are used to rotate, scale, translate, or skew UI elements. Three-dimensional (3-D) graphics capabilities include 3-D transforms, which transform UI elements in three-dimensional space.
  • Layout System. The layout system handles the tasks of drawing, resizing, and positioning the UI elements in the graphical window. This built-in functionality removes from the developer the responsibility of drawing and sizing elements on-screen by using C++ code. Silverlight for Windows Embedded supports layout container objects that work with the layout system to manage the arrangement of UI elements on-screen at run time.
  • Animation, Timers, and Storyboards. Animation storyboards can enable UI elements to appear to dynamically change or move on the screen. This effect is achieved by quickly cycling through a series of images, or key frames, each slightly different from the previous one, over a specified duration of time. This visual effect can be achieved by defining each key-frame C++ object and implementing an animation storyboard.
  • Pixel Effects. Pixel effects modify the appearance of a UI element; for example, by blurring the appearance of an element or adding a drop shadow. Pixel effects usually require hardware acceleration so that the graphics processing is done as fast as possible.
  • Text and Typography. You can use both text controls and typography to display text in a Silverlight for Windows Embedded-based application. You can customize the display of text and provide unique customizations by changing visual properties or layout, or by applying transforms to the text. By using built-in support for the XML Paper Specification (XPS), you can also use predefined glyphs in the Silverlight for Windows Embedded UI. A glyph is a rendered image that is a visual representation of a character in a font.
  • New Controls. Silverlight for Windows Embedded introduces new Silverlight for Windows Embedded controls to Windows Embedded Compact developers, such as user controls, content controls, grids, canvases, paths, rectangles, and password boxes. Each of these controls inherit from the intermediate base class IXRFrameworkElement. Silverlight for Windows Embedded also provides intermediate base classes that are specifically intended for creating custom controls.
  • Styles and Templates. Styles and templates collectively define the pieces that make up the appearance of a control and provide the default visual behavior of the control. You can apply styles and templates to controls to define a consistent look for specific types of controls in your application.
  • Geometry. Geometry objects can be used for rendering two-dimensional graphic data on-screen.
  • Triggers and Events. Triggers let developers define a custom visual behavior that is demonstrated in response to the Loaded event. Additionally, storyboard animations that show visual behavior can be started from within event-handler code. Custom visual behaviors can include changing the color, shape, or size of an object, or playing a short animation storyboard.

The following figures show the types of new Silverlight for Windows Embedded controls with custom visual appearances that you can design and add to Windows Embedded Compact applications to replace the standard Microsoft Win32 controls.

Progress Bars

Figure 2: Progress Bars

List Boxes

Figure 3: List Boxes

Scroll Viewers

Scroll Viewers

Sliders

Sample Home Screen with Theme 1, medium screen

Programming Model in Silverlight for Windows Embedded

Silverlight for Windows Embedded offers a comprehensive C++ API that is interoperable with XML-based declarative markup and has no dependency on the .NET Framework.

By using Silverlight for Windows Embedded, embedded OEMs can either completely predefine the visual appearance, effects, and behavior in source XAML, or use the C++ programming model to create or customize the UI appearance and functionality for the shell and applications.

Developers can use the Silverlight for Windows Embedded C++ API to load and display an existing XAML UI, implement event handling for the XAML elements, or customize the UI at run time by adding new elements or changing the visual appearance to respond to factors present at run time.

To enable interaction with the XAML UI at run time, Silverlight for Windows Embedded provides Win32 support for hosting the Silverlight for Windows Embedded visual tree. It also uses the same visual tree to store new objects that are added by C++ application code at run time.

Design Workflow in Silverlight for Windows Embedded

Silverlight for Windows Embedded provides Windows Embedded Compact 7 developers and XAML designers with the API and tools for creating advanced UIs. By using Silverlight for Windows Embedded, OEMs can use the C++ Silverlight for Windows Embedded programming model to create UI elements, graphics, and animations that take advantage of blend effects, weights, shadows, and gradients. OEMs can also work closely with XAML designers who use Expression Blend 3 to develop customized device UIs for both the shell and applications.

XAML designers can design UIs with XAML by using Expression Blend 3, and embedded developers can develop UI functionality in C++ by using Platform Builder.

The following figures show examples of themes that are designed by using Silverlight for Windows Embedded XAML for a Windows Embedded Compact-powered device.

Sample Home Screen with Theme 1 for Medium Size Screens

Fig 7: Sample Home screen, theme 2, small size

Sample Home Screen with Theme 2 for Small Size Screens

Figure 7: Sample home screen, theme 2 small screen

Win32 Control Compatibility

Silverlight for Windows Embedded is interoperable with the Win32 controls that were developed in previous versions of Windows Embedded Compact.

By using Win32 control compatibility, you can add window controls, such as a combo box, button, or list box, to the Silverlight for Windows Embedded object tree at run time, without needing to rewrite or change the source code for your window controls.

In This Section

See Also

Concepts

Application Development
Silverlight for Windows Embedded Code Samples
Window Compositor Developer's Guide
Application Deployment

Other Resources

Silverlight for Windows Embedded Catalog Items and Sysgen Variables
Silverlight for Windows Embedded Reference