Select New project --> SliverLight -->
New Silverlight Dialog will open -- Check the Host Silverlight Application in new website
By checking the check box , The Silverlight Application is new hosted in to the website by default with same silverlight Application Name.
--> Ok
Two projects are Created:
1.silverlight Application(with name u have given)
2. A new website application
In Silverlight Application
Properties Folder AppManiFest.Xaml is required to generate Application pacakage (.Xap file). This file created .xap file in web application when you build.
In Silverlight : App.xaml works same as Global.asax in web forms
Copy and Paste code below in Main.xaml and Main.Xaml.cs
Build the Application and see the Output.
Main.Xaml:
<Grid x:Name="LayoutRoot" Background="White">
<Button Content="Hello" Height="58" HorizontalAlignment="Left" Margin="95,130,0,0" Name="btnHello" VerticalAlignment="Top" Width="83" Click="btnHello_Click" />
</Grid>
Main.Xaml.cs:
private void btnHello_Click(object sender, RoutedEventArgs e)
{
MessageBox.Show("Hello SilverLight");
}
No comments:
Post a Comment