Silverlight application creation Base article

Source: Internet
Author: User
Tags silverlight

S2010 Strong and fast support is really surprising. Custom Start page, multi-monitor support ... These are too many, I will not say one by one, who knows with WHO.

VS2010 integrates SILVERLIGHT3 to facilitate the development of Silverlight programs.

To establish a project:

Open vs2010, create a new project, see many options, select Silverlight


The Silverlight hosting program is created below, and you can choose

You can also select the Silverlight version.

After the project is created, do not do anything more, direct build. You'll find the project folder ClientBin files/silverlightappdemo1.xap

SILVERLIGHTAPPDEMO1.XAP is the output file that compiles the packaged SilverlightAppDemo1 project. It's just a compression.

This file contains all the files required by the Silverlight application, such as assemblies, resource files, and so on. The XAP suffix here does not have any special meaning, just the Silverlight application

The extension of the package file after the program is compiled is, in essence, a standard zip-compressed file.


To create a simple Silverlight program

Add a Silverlight control to MainPage.xaml, note that it is not added in silverlightappdemo1testpage.aspx

Writing in MainPage.xaml.cs

Private void Btnme_click ( object sender, RoutedEventArgs e)
this. btnme.content = "Hello!" ";

this. Btnme.background = new SolidColorBrush (;

You see, in Silverlight, control content is the text of the control.

Running the project


After clicking



To create Silverlight in vs2010, you do not have to introduce the System.Web.Silverlight assembly in the. aspx file. Because the generated silverlight.js file will take you through the page's support for the control.

If the program does not run up, right-click the Silverlight program, properties. Add a reference to the silverlightapplication.


Related Article

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: 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.