Since the User Interface is represented by a bunch of XML
tags, we can easily create a XAML file using a text editor such as notepad. Let
us see how we can create a web page which will display a text as "Welcome
to Silverlight!" To begin, copy the following code and save it as
"welcome.xaml."
Listing 2
<Canvas
xmlns="http://schemas.microsoft.com/client/2007"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Name="parentCanvas"
Width="640"
Height="480"
Background="White">
<TextBlock Width="306" Height="35" Canvas.Left="10" Canvas.Top="10"
FontFamily="Verdana" FontSize="18" FontWeight="Bold" Foreground="#FFF50C25"
Text="Welcome to Silverlight!" TextWrapping="Wrap"/>
</Canvas>
Here comes the tricky part. Well, how can you test the above
code? Well, Microsoft now offers hosting of Silverlight applications for FREE
(up to 4GB of storage space) at http://Silverlight.live.com.
You will need to create a Silverlight streaming account (which is FREE) at https://silverlight.live.com/account/create.aspx.
Once an account is created, you can start uploading your silverlight
applications to your account.
But, we need to follow certain procedures before we can
upload an application. To begin with, you will have to create a file called,
"manifest.xml." To know more about the manifest.xml file, please
visit the following link http://dev.live.com/silverlight/createapp.aspx.
For our project, the manifest.xml file should like as
follows:
Listing 3
<SilverlightApp>
<source>welcome.xaml</source>
<width>400</width>
<height>100</height>
</SilverlightApp>