1. Controls
RichTextBox Control
You can use the RichTextBox Control to display, input, and edit multi-format texts. You can apply character or paragraph formats, display hyperlinks, and add Inline images to text.
Viewbox Control
The viewbox control is a content modifier that uses a child element and can be scaled or stretched to fit the viewbox size.
Webbrowser Control
The webbrowser control can be applied inProgramWhen running outside the browser, a drawing is provided for displaying HTML content.
Webbrowserbrush Control
You can use the webbrowserbrush control to display HTML content from the webbrowser control. For example, you can use webbrowserbrush to draw fill shapes such as rectangle, or to draw the geometric content of path.
2. Media
Network camera and microphone
You can now capture source input from your audio device or video device. The captureimageasync method supports simple screen capture solutions, and the videobrush. setsource method supports simple video playback solutions. More advanced solutions can read the original audio or video and process it as a file format. Both the Network camera and microphone capture use the receiver analogy to create a listener class, and obtaining the captured content requires the client user permission to access the capture device.
Offline DRM
Silverlight DRM integrates several new features for implementing offline solutions, including purchasing, downloading, leasing, and subscribing.
Multiple Transformations
You can now use the compositetransform class to apply multiple transformations to the same object, such as distortion and rotation. This class applies multiple transformations in the preferred order, which is generally more suitable for applying multiple transformations to an object than using the transformgroup class.
3. Outside the browser
Out-of-browser support
Applications outside the browser now support the following features that are unavailable to applications hosted by the browser:
The window function includes the function of adjusting the size during running, the always-before-running function, and the closing events that can be canceled.
Supports offline digital rights management (DRM.
The HTML bearer function of the webbrowser control.
Icationicationwindow class.
Support for improved Trust.
Provides improved support for debugging out-of-browser applications.
Trusted applications
You can configure an out-of-browser application to increase trust. Trusted applications can bypass certain restrictions of the Silverlight Security Sandbox and integrate with local functions. For example, an out-of-browser application running with a higher trust identity can read and write files in the user folder and use full screen mode without keyboard restrictions.
In addition, trusted applications can access window APIs, which support full customization of application windows outside the browser. For example, a trusted application can hide the title bar and border of a window and provide Custom User interface elements to move, close, or resize the window.
A security warning is displayed to users before a trusted application is installed. However, Silverlight supports application signature for trusted applications and provides more reliable warnings for applications with verified signatures.
Post-binding
Silverlight supports later binding in Visual Basic and C. By default, Visual Basic supports post-binding of Object-type variables. C # variable type dynamic can be bound later. This allows you to more easily process objects retrieved from HTML Dom or automated APIs.
To support later binding to html dom elements, the scriptobject class now implements the idynamicmetaobjectprovider interface. To support later binding to automated APIs, The automationfactory class and related classes have been added to the Silverlight framework.
4. Print
You can now print the Silverlight Application User Interface by using the printdocument class. Printdocument allows you to display a Print dialog box to users and print the application or the uielement contained in the application.
5. User Interface
Drag and Drop
Silverlight 4 introduces APIs to support drag-and-drop operations. You can select a file list from an application outside the Silverlight content area, for example, from "My Documents" in Microsoft Windows. You can then drag the selected file list to the Silverlight content area to process placement events for specific target elements, and then use fileinfo information (including access to the file content through the stream) to process the file list. You can enable the preceding operations by adding drop events and related events and attributes to the basic uielement class. Supported classes, such as drageventargs, are also included.
Clipboard access
Silverlight 4 introduces APIs to support access to clipboard objects. You can obtain or set Unicode text information for shared clipboard objects. Note that this type of access requires "selective addition" User Permissions and is limited to Unicode text data. More restrictions are described in the clipboard Reference topic.
Right-click the mouse event
Silverlight 4 adds the mouserightbuttondown and mouserightbuttonup events to the basic uielement class. The application can now process right-click the mouse event and change the behavior. By default, When you right-click a Silverlight application, the Silverlight configuration dialog box is displayed.
Command
In Silverlight 4, buttonbase and hyperlink support the command and commandparameter attributes. The command attribute can be implemented by referencing the icommand from the view model data source through the {binding} usage. Silverlight then enters the system to explain the command at runtime.
Implicit Style
You can now set the style implicitly. Implicit style allows you to apply a style to all elements of a certain type.
Stream direction from right to left
You can now set the content and layout direction of each control to flow from right to left. In this way, Silverlight applications can be developed in international languages (such as Hebrew and Arabic. You can use the flowdirection attribute to set the stream direction.
Full Screen support
Silverlight now supports applications that remain in full screen mode when another application is active.
Basic Element API changes
Except for previous functions, the following changes in dependencyobject, uielement, and frameworkelement may be related to the UI scheme:
Frameworkelement...: The cursor attribute can now be set using the attribute system API.
Frameworkelement has an unloaded event.
Supports text events in the input method editor at the uielement level so that you can use routes.
The setvalue call is more consistent with the WPF equivalent behavior, especially when an animation is run.
6. Data
Data Binding
Silverlight data binding now supports the following features:
Bind to the dependencyobject instance.
Bind to the string indexer.
You can use the stringformat attribute to specify the string format setting option.
You can use the fallbackvalue and targetnullvalue attributes to specify the default display value.
You can group collection items through the groupdescriptions attribute of the collectionviewsource class.
For the icollectionviewfactory interface, this interface supports custom icollectionview implementation for the collectionviewsource and DataGrid classes.
Support for complex and multi-attribute verification of objects bound to inotifydataerrorinfo or idataerrorinfo interfaces. This includes supporting these interfaces by binding the engine and user interface controls (such as DataGrid.
For more information, see data binding.
The newly added dataservicecollection <(of <(<'t>)> class provides simplified binding for data returned by the WCF Data Services-WCF data service. This class inherits from the observablecollection <(of <(<'t>)> class, which is used to automatically update bound data when data in the bound control is changed. For more information, see How to bind data service data to controls (WCF Data Service/Silverlight ).
WCF Data Services-WCF Data Service
In this Silverlight release, the following features are added to the WCF Data Services-WCF data service client:
The newly added dataservicecollection <(of <(<'t>)> class provides simplified binding between data service data and Silverlight controls. This class inherits from the observablecollection <(of <(<'t>)> class, which is used to automatically update bound data when data in the bound control is changed. For more information, see How to bind data service data to controls (WCF Data Service/Silverlight ).
The WCF Data Services-WCF data service client for Silverlight currently supports cross-origin and external browser execution. For more information, see WCF Data Service (Silverlight ).
In this Silverlight release, the WCF Data Services-WCF data service client supports the following new Open Data Protocol (odata) features:
The odata service can only return the total number of resources represented by the URI, or include the Count information of this row with the resource data in a single response. The WCF Data Services-WCF data service client for Silverlight is now updated, allowing you to access this row of counting information in the query response of your application. For more information, see querying the Data Service (WCF data services )).
You can configure the data service to return the request resources that serve as a group of paging responses. The WCF Data Services-WCF data service client for Silverlight is now updated to support processing such paging responses. For more information, see loading deferred content (WCF Data Services) (loading delayed content (WCF Data Service )).
The query results returned by the odata service can now be projected to any defined type. The WCF Data Services-WCF data service client for Silverlight is now updated. You can use the select clause (select in Visual Basic) in the linq query to support projection. For more information, see query projections (WCF Data Services) (query projection (WCF Data Service )).
The WCF Data Services-WCF data service client for Silverlight is now updated. You can obtain or set binary attributes as a stream from odata services that support media resources. For more information, see loading deferred content (WCF Data Services) (loading delayed content (WCF Data Service )).
7. Application Model
WCF Ria Service
The WCF Ria service simplifies the development of N-layer solutions for multiple Internet applications (such as Silverlight applications. A common problem when developing a n-layer Ria solution is to coordinate the application logic between the middle layer and the presentation layer. The RIA service solves this problem by providing the application logic on the server that can be used for the framework components, tools, and services of the RIA client, without the need to manually copy the programming logic. The RIA service can be used with Silverlight 4, but is provided as an independent installation software. For more information, see WCF Ria services ).
Navigation scalability
You can extend the Silverlight navigation function to support arbitrary URI parsing. For example, you can implement navigation extension for Uri redirection, dynamic page generation, and download pages from the server as needed.
The frame and navigationservice classes also provide the refresh method. This is especially useful when you use a navigation extension that provides different content for the same URI based on user interaction on a specific page. For example, this can implement some navigation schemes for pages that require user authentication.
For more information, see the navigation overview.
Dynamic Language Runtime
Dynamic Language Runtime (DLR) is a new runtime environment that adds a set of services suitable for dynamic languages to CLR. To support DLR, a new system. Dynamic namespace is added to the. NET Framework, and the expression tree is extended using a new type that represents the control flow (such as loopexpression and tryexpression.
For more information, see Dynamic Language Runtime Overview (Dynamic Language Runtime Overview ).
The above are the main new features of silverlight4.
1. XAML
2. Core (Collection class, tuples, analysis interval and format setting, other core functions)
3. Silverlight designer
4. Windows Phone platform support
If you are interested, follow me.