Silverlight3 Study Notes stenographer

Source: Internet
Author: User
Tags pixel coloring

1. how to add and use custom Fonts

The Artist designed a UI, but some fonts are not in the list of fonts supported by Silverlight.

Add the font to helloworlddemo. add a font file in the same directory or project as the xap file, right-click the project, add an existing item, select the newly added font file, and set its property build action to resource, in this way, we can use the added font in our project. For example:
Double-click the newly added arlrdbd. TTF font file. You can see that the font we just added contains Arial rounded Mt bold.

Open the helloworld. Xmal file and set the textblock font as follows:

<Textblock text = "hello" fontsize = "30" foreground = "white" fontfamily = "./arlrdbd. TTF # Arial rounded Mt bold"/>

Press Ctrl + F5 to start the website. You will see that the font we added has been used.

2. What is deep zoom composer?

Deep zoom composer is a technical preview of Microsoft. You can use this tool to create and use the deep zoom feature to display images.

Using this tool, we will create a smooth way to display images on the network, especially the applications of high-pixel images.Program

Download: http://www.microsoft.com/downloads/details.aspx? Familyid = 457b17b7-52bf-4bda-87a3-fa8a4673f8bf & displaylang = en

3. Custom mouse prompt information

In Silverlight, You can implement the following two methods: 1. tooltipservice. tooltip 2. Popup Control

4. Functions of Some Important controls

Repeatbutton is a special button that can respond to consecutive mouse clicks.

Togglebutton is a three-state button (that is, there are three click states: indeterminate, checked, and unchecked ),

By using this control, you can easily implement the previously required JavaScript code.CodeStatus flip.

The slider control is a very important control, especially for network multimedia players.

Sometimes you need to put too much content, but the space of a page is limited, tabcontrol can solve your problems

Silverlight provides us with three powerful weapons: grid, stackpanel, and canvas,

Finally, we will introduce the border control, which is often used in the layout, especially its rounded corner function.

5. WCF Communication

Silverlight's WCF binding only supports binding = "basichttpbinding"

To publish this application through IIS, you must register the WCF component (otherwise, the. SVC file cannot be recognized, and your WCF communication will be paralyzed)

In this way, your Silverlight can run normally on IIS. Of course, you need to add two MIME types for IIS to identify. xap and. XAML.

6. Silverlight unit test

Microsoft provides us with support for Silverlight unit testing. Download The Silverlight unit test vs template and the Silverlight unit test framework binaries library.

7. Live Search Web Search

Silverlight can use the Live Search API of Microsoft's Live Search Service Project to search Web pages, images, and information.

8. New Features

Support for high-quality videos and audios

Online On-Demand 720 p + streaming media playback support: provides an IIS plug-in called IIS Media Pack. It allows Silverlight to monitor users' bandwidth and CPU

Status, and then enable IIS to pass videos with the appropriate bit rate.

Support for more multimedia formats: in addition to support for the original VC-1/WMA, Silverlight 3 added support for H.264/AAC audio formats based on MPEG-4 formats.
In addition, Silverlight 3 supports third-party decoders. Video and audio can be decoded outside of runtime and then presented in Silverlight 3

Full support for 3D: third-party development kits are not needed to achieve the 3D effect of Silverlight.

Pixel coloring effect: Fuzzy and projection effects are supported internally.

New bitmap API: This new API makes it easier for us to operate on each pixel of a bitmap. This makes it possible to develop a Web image editor.

Supports GPU Acceleration

Animation effect: supports multiple types of animation effects, such as spring, bounce, and elastic.

Built-in navigation mechanism, supporting deep links

Support for Seo: in this way, you can use Silverlight for network applications, so you don't have to worry about the SEO problem. As a result, the search engine cannot search to reduce the website's popularity.

Enhanced Data Binding support: supports element-to-Element Binding similar to WPF

Dataform control: displays, edits, and updates data, and provides verification and paging functions (the paging function is implemented by datapager)

Offline function: supports installation and running of network applications on the desktop offline.

9. WCF

Tips for configuring WCF:

For web. right-click config and choose "open mode"> "add"> "program name... -> C: \ Program Files \ microsoft sdks \ windows \ v6.0a \ bin \ (if you use the default path when installing the development platform, it will be found in this path) -> select svcconfigeditor.exe-> open-> OK.

Cross-origin file creation:

For security reasons, if Silverlight wants to access the WCF Service of different domain names, it must create a cross-domain file in the host of the WCF Service. Otherwise, an error is prompted.

(Note: if the host of your WCF Service is IIS, the file must be in the root directory of IIS, not the root directory of the WCF Service)

10. Differences between crossdomain. xml and clientaccesspolicy. xml

To allow cross-origin access to sliverlight, you usually need to add a cross-origin policy file.

However, among the many materials that can be found, the functions of these two files are not very clear, and there are always a few questions to be answered:

1. Can these two files be selected? What are their similarities and differences?

2. Do these two files need to be placed on the server or the client?

3. Can these two files be used no matter whether the background service is deployed in IIS or other environments?

Can be placed on the server as needed

Can be used, you can select as needed, many websites have set crossdomain. xml not necessarily in IIS

Like http://www.yahoo.com/crossdomain.xml

I would like to add some experience in placing cross-origin access files on the server.

To implement cross-origin access, Silverlight must configure the clientaccesspolicy. XML (or crossdomain. XML) file under the direct domain name of the accessed domain on the server,
You can access http: // % 7 bdomainname % 7D/clientaccesspolicy. xml
Specifically, if the background service is deployed in IIS, it is stored in the "inetpub/wwwroot" directory by default. If the background service is deployed in Tomcat, by default, it is stored in the "Tomcat \ webapps \ Root" directory.

These two files do not need to be placed under the domain root, but I prefer clientaccesspolicy because it can be used to set the socket.

Their differences are described in B2's document:

Silverlight supports two types of security policy files:

Flash policy file-the existing crossdomain. xml policy file used by Adobe Flash. This policy file can only be used by the WebClient and HTTP classes in

System. Net namespace. A flash policy file must allow access to all domains to be used by the Silverlight 2 Runtime.

Silverlight policy file-The Silverlight policy file that can be used by the WebClient and HTTP classes in the system. Net namespace and also by the sockets

Classes in the system. net. Sockets namespace. This policy file has a different format than the flash policy file.

All in all, Silverlight policy can be used by all kinds of connection between client and server.

Refer to your question, if you only put one of them onto the root, cross-domain-access is also allowed, but for crossdomain. xml crossdomain for sockets doesn't allow.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.