1. download microsoft Silverlight Tools Beta 1 for Visual Studio 2008 54.5 MB
2. Double-click to install
3. Open vs 2008 and create a project Visual C #
Contains two items: Silverlight class library and Silverlight application.
4. Select Silverlight application and name it myfirstsilverlight.
5. Select Web application project in project type
After clicking OK, Visual Studio will create a solution for us, which contains a Silverlight client application and an ASP. NET web server application.
6. Now let's make the first hello World !!
Click page. xml.
EnterCode~~
<Grid X: Name = "layoutroot" background = "white">
<Button X: Name = "button1" content = "click I'll try" width = "100" Height = "50" Click = "button#click"/>
</GRID>
When clicking is input, click Create event processing.Program
Vs automatically creates an event processing function in our background code file.
7. Enter the code in page. XAML. CD.
Using System;
Using System. Collections. Generic;
Using System. LINQ;
Using System. windows;
Using System. Windows. controls;
Using System. Windows. documents;
Using System. Windows. input;
Using System. Windows. Media;
Using System. Windows. Media. animation;
Using System. Windows. shapes;
NamespaceMyfirstsilverlight
{
Public Partial ClassPage: usercontrol
{
PublicPage ()
{
Initializecomponent ();
}
Private VoidButton#click (ObjectSender, routedeventargs E)
{
Button1.content= "Hello world !!";
}
}
}
8. Run ~~