In this step we begin in Visual Studio to create a Silverlight application using Uploader for Silverlight. We create a new Silverlight project and set up the application.
To set up your project, complete the following steps:
- In Visual Studio, select File | New | Project.
- In the New Project dialog box, select a language in the left pane, and in the templates list select Silverlight Application. Enter a Name for your project, for example "QuickStart," and click OK. The New Silverlight Application dialog box appears.
- Click OK to accept the default settings, close the New Silverlight Application dialog box, and create your project. The MainPage.xaml file opens.
- Right-click the project in the Solution Explorer window and select Add Reference.
- In the Add Reference dialog box, locate and select the C1.Silverlight.dll and C1.Silverlight.Uploader.dll assemblies and click OK to add references to your project.
- In the XAML window of the project, place the cursor between the <Grid> and </Grid> tags and click once.
- Add the following XAML markup between the <Grid> and </Grid> tags in the MainPage.xaml file:
XAML |
Copy Code
|
<StackPanel Orientation="Horizontal" Height="250" HorizontalAlignment="Center">
<Button Content="Upload Photos" Height="30" VerticalAlignment="Top" Margin="5" Click="Upload_Click" />
<ScrollViewer Width="400" Margin="5" Background="White">
<StackPanel x:Name="PicturePanel"/>
</ScrollViewer>
</StackPanel>
|
This markup creates a button and a panel. Users click the button to upload image files to the server and the panel displays the images.
- Right-click the QuickStartWeb application in the Solution Explorer and select New Folder. Name the folder "Pictures." Note that if you name your project something other than "QuickStart" you right-click MyProjectWeb where "MyProject" is the name of your project.
This folder is used to save the uploaded images. After you create the Pictures folder, you may need to set up its permissions so the application can save the pictures into the folder. You may need to confirm that the network service has read and write permissions on the folder.
What You've Accomplished
You have successfully created and set up a Silverlight application and added controls to the page. In the next step we add code to implement the C1Uploader class.
See Also