Поделиться через


What's New in Silverlight for Windows Phone

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Silverlight for Windows Phone OS 7.1 is based on Silverlight 4. That means if you create a new Silverlight for Windows Phone application that targets Windows Phone OS 7.1, you can take advantage of several new features. You can still write applications that target Windows Phone OS 7.0, but to take advantage of the new features, you must target Windows Phone OS 7.1. Applications that target Windows Phone OS 7.0 will run on devices running Windows Phone OS 7.1. This topic introduces some of the new features and improvements in Silverlight for Windows Phone.

This topic contains the following sections.

  • Controls
  • Media
  • Networking
  • Performance
  • User Interface
  • XAML
  • Data
  • Core
  • Compatibility
  • Related Topics

Controls

RichTextBox Control

Silverlight for Windows Phone includes a read-only RichTextBox control that enables you to display rich text. You can display text with character or paragraph formatting, hyperlinks, and inline images. For more information, see RichTextBox Overview and RichTextBox.

Viewbox Control

The Viewbox control is a content decorator that takes one child element and stretches it or scales it to fit the size of the Viewbox. For more information, see Viewbox.

WebBrowser Control

The WebBrowser control provides a surface for displaying HTML content when the application runs outside the browser. This control is now based on Internet Explorer 9. For more information, see WebBrowser.

Media

Webcam and Microphone

You can now capture source input from the user's audio device or video device. The CaptureImageAsync method enables simple capture scenarios and the VideoBrush.SetSource method enables a simple video playback scenario. Webcam and microphone capture both use a sink metaphor for establishing a listener class, and obtaining a capture requires client user permission for capture device access.

Improved Image Support

Windows Phone devices now support 32 bit-per-pixel (bpp) images. The default is 16 bpp, but you can change this setting in the WMAppManifest file to 32 bpp. For more information, see Application Manifest File for Windows Phone.

Networking

Multicast

The System.Net.Sockets namespace has added support for UDP multicast clients. This enables network clients to take advantage of multicast applications that more efficiently use network resources. For more information, see the Working with Multicast topic and the System.Net.Sockets.UdpAnySourceMulticastClient and System.Net.Sockets.UdpSingleSourceMulticastClient classes.

Web Client Improvements

The WebClient class now returns on the calling thread. This means calls with WebClient have improved performance. If you call WebClient on a background thread you will need to marshal the call back to the UI thread. The behavior of WebClient in Windows Phone OS 7.0 applications has not changed.

Performance

An input thread has been added to improve performance for things such as ListBox scrolling.

Images are now decoded on a background thread, which means text and other elements will appear quickly and the images will load when they are available.

User Interface

Clipboard Access

Silverlight for Windows Phone introduces APIs to support clipboard object access. You can get or set Unicode text information to a shared Clipboard object. Note that such access requires opt-in user permission and is limited to Unicode text data. There are additional restrictions as described in the Clipboard class.

Commanding

In Silverlight for Windows Phone, ButtonBase and Hyperlink support Command and CommandParameter properties. The Command property can reference an ICommand implementation that comes from a view-model data source, through a {Binding} usage. The command is then interpreted at run time. For more information, see ButtonBase.Command or Hyperlink.Command.

Implicit Styles

You can now set a Style implicitly. Implicit styles allow you to apply a certain style to all elements of certain type. For more information, see Style.

Right-to-Left Flow Direction

You can now set the direction of content and layout of each control to flow from right to left. This enables you to develop Windows Phone applications in international languages, such as Hebrew and Arabic. You set the flow direction with the FlowDirection property. For more information, see FlowDirection.

Multiple Transforms

You can now use the CompositeTransform class to apply multiple transforms to the same object, such as skew and rotate. This class applies multiple transforms in a preferred order and is generally better suited for applying multiple transforms to an object instead of using the TransformGroup class.

XAML

Silverlight for Windows Phone includes a new XAML parser as part of the Silverlight 4 runtime. The new XAML parser provides the following:

  • Greater compatibility with XAML that was originally written for WPF.

  • Greater compatibility with the XAML language as defined in the [MS-XAML] specification.

  • Enables tools and other XAML consumers to integrate a design-time experience in a more predictable way.

For more information about the differences in XAML behavior between Silverlight 3 and Silverlight 4 XAML parsing, see XAML Processing Differences Between Silverlight Versions.

NoteNote:

The XAML Processing Differences Between Silverlight Versions topic was originally written for Silverlight for the desktop, but the variations between Silverlight 3 and Silverlight 4 versions for Silverlight for the desktop map fairly closely to the XAML parsing differences present between Silverlight for Windows Phone versions.

Data

Data Binding

Silverlight for Windows Phone data binding now supports the following features:

For more information, see Data Binding.

A new DataServiceCollection<T> class provides simplified binding for data returned by WCF Data Services. This class inherits from the ObservableCollection<T> class to automatically update bound data when there are changes to data in bound controls. For more information, see How to: Bind Data Service Data to Controls (WCF Data Services/Silverlight).

Core

Parsing and Formatting Time Intervals

To support culture-sensitive formatting, the TimeSpan structure now implements the IFormattable interface and includes new overloads of the ToString, Parse, TryParse, ParseExact, and TryParseExact method. Its formatting and parsing methods also support both standard and custom format strings.

Other Core Features

The following list describes new capabilities and improvements added to Silverlight for Windows Phone.

Compatibility

There have been numerous updates and improvements to Silverlight for Windows Phone. Significant work has been invested into compatibility between Windows Phone OS 7.0 and Windows Phone OS 7.1; however, you should test your existing applications on Windows Phone OS 7.1 to make sure they behave as expected. You should refer to the Version Notes section of the relevant API page to see if there are compatibility differences. In addition, you can read the compatibility notes in the following topics.