Saturday, February 04, 2012
Donwload

CreatingSilverlightApp.zip

Purpose

We are presenting here very simple and quck look at how to create Silverlight 2 application in Visual Studio 2008. Make sure to follow What do I need for Silverlight 2 development? and install all the required installations.

CreatingSilverlightApp.zip

Purpose

We are presenting here very simple and quck look at how to create Silverlight 2 application in Visual Studio 2008. Make sure to follow What do I need for Silverlight 2 development? and install all the required installations.



Step By Step

File -> New Project, Choose Silverlight project type

Add ASP.NET Web Application Project

Right click and Build Solution

Paste code below to Page.xaml

<Grid x:Name="LayoutRoot" Background="White">
      <Button Height="56" HorizontalAlignment="Left" Margin="38,0,0,67" 
VerticalAlignment
="Bottom" Width="116" Content="Button" x:Name="btnSayHello"/>
      <TextBox Height="46" Margin="38.049,44,0,0" VerticalAlignment="Top" Text="TextBox" 
TextWrapping
="Wrap" HorizontalAlignment="Left" Width="150.5" Background="#FFFFFFFF" x:Name="txtMessage"/>
</Grid>

Paste code below to Page.xaml.cs

public Page()
{
    InitializeComponent();
    btnSayHello.Click += new RoutedEventHandler(btnSayHello_Click);
}

private void btnSayHello_Click(object sender, RoutedEventArgs e)
{
    txtMessage.Text = "Milk It Does Body Good!";
}

 

Right click on CreatingSilverlightAppTestPage.aspx and select Set As Start Page

Right click on CreatingSilverlightApp.Web and select Set As StartUp Project

Hit F5

File -> New Project, Choose Silverlight project type

Add ASP.NET Web Application Project

Right click and Build Solution

Paste code below to Page.xaml

<Grid x:Name="LayoutRoot" Background="White">
      <Button Height="56" HorizontalAlignment="Left" Margin="38,0,0,67" 
VerticalAlignment
="Bottom" Width="116" Content="Button" x:Name="btnSayHello"/>
      <TextBox Height="46" Margin="38.049,44,0,0" VerticalAlignment="Top" Text="TextBox" 
TextWrapping
="Wrap" HorizontalAlignment="Left" Width="150.5" Background="#FFFFFFFF" x:Name="txtMessage"/>
</Grid>

Paste code below to Page.xaml.cs

public Page()
{
    InitializeComponent();
    btnSayHello.Click += new RoutedEventHandler(btnSayHello_Click);
}

private void btnSayHello_Click(object sender, RoutedEventArgs e)
{
    txtMessage.Text = "Milk It Does Body Good!";
}

 

Right click on CreatingSilverlightAppTestPage.aspx and select Set As Start Page

Right click on CreatingSilverlightApp.Web and select Set As StartUp Project

Hit F5


Print  

DEMO
Minimize


 

 

Privacy Statement  |  Terms Of Use
Copyright 2009 by New Age Solution Inc.