Wednesday, March 7, 2012

Hello Visual Basic Silverlight 5, using Microsoft Visual Studio 11 Ultimate Beta

- Click New Project... in start-up page of Microsoft Visual Studio 11 Ultimate Beta.
New Project...

- Select template of Silverlight under Visual Basic, Silverlight Application with name of "hello_VBSilverLight". Click OK.
New Project

- Uncheck "Host the Silverlight application in a new Web site", select Silverlight Version of Silverlight 5, click OK.
New Silverlight Application

- The application wizard will generate the start-up project for you.
Start-up Silverlight 5 project

- Edit MainPage.xaml in XAML view - double click on the XAML tab to open XAML editor, we are going to insert something using XAML manually, instead of using graphical Design tool.
Open XAML editor

- Type in something inside the <Grid> element:
<UserControl x:Class="hello_VBSilverLight.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="400">

<Grid x:Name="LayoutRoot" Background="White">
<StackPanel>
<TextBlock x:Name="textBlock" Text="Hello!"></TextBlock>
<Button x:Name="button1" Content="Click Me"></Button>
</StackPanel>
</Grid>
</UserControl>

Edit XAML

- Now, click the "Start" button. A browser will open and load your Hello World Silver 5 application.
Hello VB Silverlight 5


Next:
- Silverlight 5/Visual Basic: Add event handling code

No comments:

Post a Comment