Silverlight Author: Scott Guthrie

Source: Internet
Author: User

Silverlight 2.0 allows you to create rich interactive applications using Visual C # and Visual Basic online. Note that Silverlight 2.0 was previously called Silverlight 1.1

This is the first Silverlight network tutorial,

Original address: http://silverlight.net/Learn/learnvideo.aspx? Video = 123
Scott Guthrie demonstrates how to build a simple Silverlight application using. net.

Scott Guthrie demonstrates how to build a simple Silverlight application using. net.

Getting started with Silverlight 1.1

Start using Silverlight 1.1

The video is as follows:


The Code is as follows:

Page. XAML

<Canvas X: Name = "parentcanvas"
Xmlns = "http://schemas.microsoft.com/client/2007"
Xmlns: x = "http://schemas.microsoft.com/winfx/2006/xaml"
Loaded = "page_loaded"
X: class = "silverlightproject1.page; Assembly = clientbin/silverlightproject1.dll"
Width = "640"
Height = "480"
Background = "# ffe41f1f"
>
<Canvas. Resources>
<Storyboard X: Name = "timeline1">
<Doubleanimationusingkeyframes begintime = "00:00:00" storyboard. targetname = "mymessage" storyboard. targetproperty = "(uielement. rendertransform ). (transformgroup. children) [3]. (translatetransform. y) ">
<Splinedoublekeyframe keytime = "00:00:00. 2000000" value = "137"/>
<Splinedoublekeyframe keytime = "00:00:00. 6000000" value = "25"/>
<Splinedoublekeyframe keytime = "00:00:01. 4000000" value = "65"/>
</Doubleanimationusingkeyframes>
<Doubleanimationusingkeyframes begintime = "00:00:00" storyboard. targetname = "mymessage" storyboard. targetproperty = "(uielement. rendertransform ). (transformgroup. children) [3]. (translatetransform. x) ">
<Splinedoublekeyframe keytime = "00:00:00. 2000000" value = "90"/>
<Splinedoublekeyframe keytime = "00:00:00. 6000000" value = "-16"/>
<Splinedoublekeyframe keytime = "00:00:01. 4000000" value = "-11"/>
</Doubleanimationusingkeyframes>
<Doubleanimationusingkeyframes begintime = "00:00:00" storyboard. targetname = "mymessage" storyboard. targetproperty = "(uielement. rendertransform ). (transformgroup. children) [2]. (rotatetransform. angle) ">
<Splinedoublekeyframe keytime = "00:00:00. 2000000" value = "0"/>
<Splinedoublekeyframe keytime = "00:00:00. 6000000" value = "56.62"/>
<Splinedoublekeyframe keytime = "00:00:01. 4000000" value = "363.996"/>
</Doubleanimationusingkeyframes>
</Storyboard>
<Storyboard X: Name = "storyboard1">
<Doubleanimationusingkeyframes begintime = "00:00:00" storyboard. targetname = "mymessage" storyboard. targetproperty = "(uielement. rendertransform ). (transformgroup. children) [3]. (translatetransform. x) ">
<Splinedoublekeyframe keytime = "00:00:00" value = "117"/>
<Splinedoublekeyframe keytime = "00:00:00. 5000000" value = "-16"/>
</Doubleanimationusingkeyframes>
<Doubleanimationusingkeyframes begintime = "00:00:00" storyboard. targetname = "mymessage" storyboard. targetproperty = "(uielement. rendertransform ). (transformgroup. children) [3]. (translatetransform. y) ">
<Splinedoublekeyframe keytime = "00:00:00" value = "89"/>
<Splinedoublekeyframe keytime = "00:00:00. 5000000" value = "8"/>
</Doubleanimationusingkeyframes>
<Doubleanimationusingkeyframes begintime = "00:00:00" storyboard. targetname = "mymessage" storyboard. targetproperty = "(uielement. rendertransform ). (transformgroup. children) [2]. (rotatetransform. angle) ">
<Splinedoublekeyframe keytime = "00:00:00" value = "99.93"/>
<Splinedoublekeyframe keytime = "00:00:00. 5000000" value = "359.264"/>
</Doubleanimationusingkeyframes>
</Storyboard>
</Canvas. Resources>
<Textblock X: Name = "mymessage" text = "Hello World" fontsize = "56" canvas. top = "159" canvas. left = "145" rendertransformorigin = "0.5, 0.5">
<Textblock. rendertransform>
<Transformgroup>
<Scaletransform scalex = "1" scaley = "1"/>
<Skewtransform anglex = "0" angley = "0"/>
<Rotatetransform angle = "0"/>
<Translatetransform x = "0" Y = "0"/>
</Transformgroup>
</Textblock. rendertransform>
</Textblock>

</Canvas>

Page. XAML. CS

Using system;
Using system. windows;
Using system. Windows. controls;
Using system. Windows. documents;
Using system. Windows. Ink;
Using system. Windows. input;
Using system. Windows. Media;
Using system. Windows. Media. animation;
Using system. Windows. shapes;

Namespace silverlightproject1
{
Public partial class page: canvas
{
Public void page_loaded (Object o, eventargs E)
{
// Required to initialize Variables
Initializecomponent ();
Mymessage. mouseleftbuttondown + = new mouseeventhandler (mymessage_mouseleftbuttondown );
Timeline1.completed + = new eventhandler (timelineappscompleted );
}

Void timeline1_completed (Object sender, eventargs E)
{
Mymessage. Text = "The End ";
Throw new notimplementedexception ();
}

Void mymessage_mouseleftbuttondown (Object sender, mouseeventargs E)
{
// Mymessage. Text = "I was pushed ";
// Throw new notimplementedexception ();

Timeline1.begin ();
}

}
}

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.