×

First time here?

You are looking at the most recent posts. You may also want to check out older archives. Please leave a comment, ask a question and consider subscribing to the latest posts via RSS or email. Thank you for visiting!

This is a first part in a series of getting started posts for Silverlight developers. 

In our series in getting started, we’ll eventually build out an application that searches Twitter for monitoring keywords and automatically refreshes at a specified interval.  Before we start getting too deep, let’s make sure you have the tools necessary to get started and understand the fundamentals of the developer experience for Silverlight.

The Tools

Of course, with any development all you need is a text editor and a compiler, but you’d be crazy these days not to use world-class tools.  That being said, what I will propose here are a set of tools to make your complete development experience with Silverlight simpler and faster.  Not all are required (again, you just need notepad and a compiler if you are hard core :-)).  Not all are free either.  But I highly recommend them not just because I work at Microsoft, but I truly believe they are the best tools for the job.

Visual Studio 2008

You’ll want to make sure you have Visual Studio 2008 in your first bag of tricks.  You will need Service Pack 1 for VS installed to get the Silverlight tools, so make sure you have that.  Any version of Visual Studio 2008 SP1 will work with the tools.  If you do not have a copy of Visual Studio 2008, you can use one of the free express versions, Visual Web Developer Express 2008 to do Silverlight development.  If you plan on doing database development as well, you can get SQL Server 2008 Express as well for no cost.

Silverlight Tools for Visual Studio

The Silverlight Tools for Visual Studio is an additional download that installs the SDK, developer runtime (for debugging) and a set of tools for Visual Studio (project templates, build targets, etc.).  This one package installed on top of VS will get you everything you need for your VS development environment for Silverlight.

For both of these, Visual Studio and Silverlight Tools, you can download them separately.  If you already have VS, just download and install the Silverlight Tools and you will be up and running.  If you don’t have VS, consider using the Web Platform Installer which will install Visual Studio, SQL Server Express and the Silverlight Tools for you – without you having to hunt around for the installers.  You can get the Web Platform Installer here:

Web Platform Installer with Silverlight Tools

If you already have Visual Studio installed, you can still install the Silverlight Tools using WebPI or you can download them directly here.

Expression Blend

Expression Blend is an interactive developer tool.  It is a visual designer for XAML, the underlying presentation technology for Silverlight and Windows Presentation Foundation (WPF) applications.  It has a great design surface and allows for easy manipulation of layout, animations, styling and templating.  I believe this to be an essential tool in XAML development.  This tool, however, is not available at zero cost.  If you have an MSDN Subscription it is included in some levels.  It can also be purchased as a part of Expression Studio.  You can download an evaluation copy of Expression Blend 3 here to get started.  We will use Blend for layout in the next step.

Silverlight Toolkit

The Silverlight Toolkit is a set of additional controls that are available outside of the core control set.  These include charting controls, date/time controls, accordions and much more.  Best of all, the source code for these controls (as well as all the core controls) are included for you to learn from and extend!

The toolkit is available for download from CodePlex and we will be using some controls from it in this series.

There are other control suites and tools you can use like .NET RIA Services which we will discuss in step 3, but I think the above are my recommended minimum tools you should have for Silverlight development.  Install them all before proceeding in this tutorial in step 2.

Understanding the development environment

Once you install Visual Studio and the Silverlight Tools you will notice a new grouping in the VS New Project dialog box:

New Project Dialog Box

You will see some new templates under the category Silverlight which include at least Silverlight Application, Silverlight Class Library and Silverlight Navigation Application.  Some others you may see depending on additional tools you may have installed.

For this step, choose the Silverlight Navigation Application template and give it a name for the application (I’m calling mine TwitterSearchMonitor).

The next window you will see will ask you if you would like to create a web project:

New Silverlight Application Dialog Box

If this is a new project, I highly recommend choosing to create a web project for you.  By doing this you will have a web context to run the application for you.  This is helpful in avoiding issues around accessing web services from the local file system.  Running your application under HTTP from the start will help you avoid some of the most common mistakes in debugging web service access.  You can choose the ASP.NET Web Application Project, ASP.NET Web Site or ASP.NET MVC Project if you have that installed.  If you aren’t sure, just use the defaults.

The Project Structure

Once your app is created you will see something similar like this:

Silverlight project structure

This shows your web application (which will host the Silverlight application) with pre-created test pages for the Silverlight application and the Silverlight application itself.  Let’s focus first on the Silverlight application project.

There are some key files you should be aware of here that we’ll explore in this series:

  • App.xaml – this is an application-wide resource file.  If you put resources in here (we’ll explore in styling) or global events upon startup, they will happen here.  This file is also the entry point to your application and tells the Silverlight plugin what to do next.
  • MainPage.xaml – this is a page that is a part of the template you chose.  It doesn’t have to be called MainPage, but that is what the project template uses by default.  This represents the starting user interface for your application.  Don’t be confused by details just yet.
  • Assets/Views folders – these contain assets (files, images, styles, etc.) and other UI views for your application.

The XAML files are the files that make up the UI of your application.  They are just XML files with the XAML markup language.  We will be altering these in later steps.

When you build the solution (go ahead and do that) you’ll notice in the web application’s ClientBin folder a new file with a XAP extension will show up.  This is your compiled Silverlight application.  It’s actually an archive (aka ZIP) file with a different extension file name.  If you rename it to .ZIP and open it using an archive tool you can see the contents.

The XAP file is what is served to your browser.  This is the file that is hosted on the web server and gets delivered to the end user.  The XAP is hosted within a standard HTML page that hosts the Silverlight application using the <object> tag instantiation. 

NOTE: Silverlight is a client technology and can be hosted on any web server.  It can be any type of web server that is capable of delivering the XAP file along with the correct content MIME type from the server (application/x-silverlight-app).  As long as it does that, we don’t care what type of web server it is delivering the XAP file.

Test pages for ASP.NET and HTML are created for you with the standard template.  Since both of them are the same essentially, I usually delete one of them for simplicity.

Adding UI to the XAML pages

The template we chose is a navigation application template, meaning it has some navigation features built into it.  This is a fairly new feature to Silverlight and enables you to have a “master page” kind of view in your application.  If you look in the Views folder you will see About.xaml, ErrorWindow.xaml and Home.xaml.  For now let’s focus on Home.xaml since that is the first view that is loaded.  Open that file up by double-clicking it and you’ll see the XAML load in Visual Studio.

In this page you’ll see some XAML code that defines the view in a Grid that uses some other layout controls like a StackPanel and TextBlocks (we’ll go into StackPanel in the next step 2).  These are all part of the core control set that Silverlight provides.  A TextBlock enables you to present text to the user.  If you run the application now (hit F5 to run in debug mode – go ahead and choose to modify the web.config to enable debugging) you should see something like this:

Running Silverlight application

Notice the text in the running application matches the text in the TextBlock of the XAML.  Also notice the link style buttons in the upper right.  These represent our navigation points which go to our separate views.  Let’s add some more XAML and see how to write code.

In the Home.xaml view, after the second TextBlock, add a Button using this XAML:

   1: <Button Content="Click me" x:Name="MyButton" FontSize="18" Width="150" Height="45" />

This will display a button on the view just underneath the “Home page content” text area.  Notice the x:Name attribute?  This is the unique identifier for this element and helps us reference it in code.  Think of this as the ID attribute of the control.  Now let’s make it do something when clicked.  There are two ways we can add events to the Button (or other elements) with simplicity.  In the XAML for Button itself we can add a Click attribute and you will see VS Intellisense automatically ask us if we want to generate a new event handler:

We can also wire up the event handler in code directly and keep it out of our XAML using this code in the Home.xaml.cs page:

   1: public Home()
   2: {
   3:     InitializeComponent();
   4:     MyButton.Click += new RoutedEventHandler(MyButton_Click);
   5: }

Either way will work.  For simplicity for now you can use whatever you like…I will use the XAML method for now.  Now in the function MyButton_Click we can write managed code in the function to manipulate our user interface or other functions.  Let’s finish our Hello World sample by changing the HeaderText TextBlock (HeaderText is the x:Name value so we can reference it easily in code) to “Hello World” output.  To do that we’ll write this function code:

   1: void MyButton_Click(object sender, RoutedEventArgs e)
   2: {
   3:     HeaderText.Text = "Hello World!";
   4: }

After making these changes and running the application again (F5) we will see our button and when clicked it will change the text like below:

finished product animation

Next Steps

We’ve created our first Hello World Silverlight application.  We’ve got more to do to complete our Twitter search application.  Let’s move to step 2 to change some of our layout of our views for our application.  For more information on getting started check out the other resources here:

We won’t provide the code download here because this was just to get us started.  Future steps we’ll include a link to the finished project always.  Hope this helps…let’s move on to part 2!


This work is licensed under a Creative Commons Attribution By license.


10/6/2009 9:44 PM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
I am very new to development so this may seem basic. I started the application as directed. It is in read-only mode. How do I change this so I can add code? Thanks
10/7/2009 7:48 AM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Karen -- I assume when you mean "started" you did the F5 to actually run the application? You can't edit code while you are in debug mode. Simply close the browser (or stop debugging) and you can edit the code.
10/7/2009 10:18 AM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Finally made my first steps in Silverlight. KISS all over the place. This first part gives a simple and solid structure to experiment with. Great!
Gravatar
10/8/2009 8:19 AM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Excelent! Will continue on the series.
[]s,
GB
10/14/2009 10:28 PM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
This helps alot,I did video on navigation but had trouble following code in video,was to fast for me. then download code but not run apparently due to web config. So started here and this format works for me.Thanks Tim,you do have an audience.
10/17/2009 3:10 PM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Hi Tim, just trying out your tutorials, but i do not have the Views or Assets folders you appear to - I have downloaded everything as mentioned, any idea what i've done?

Cheers
10/18/2009 5:00 PM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Hi there Tim. I like your writing style. This is very interesting stuff. I want to eventually create OLAP presentation for Analysis Services. Do you know if RIA will simplify hooking up to ADOMD.NET?
10/18/2009 5:41 PM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Mike - make sure you choose the Silverlight Navigation Application template.

Bobby T - I am not sure how well that would work, but only because I've not tried :-)
Gravatar
10/19/2009 9:03 AM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Hi Tim - After I create the project and click OK, I get an error which says HRRESULT: STG_E_FILENOTFOUND. I am not sure why I am getting this. I am not able to create the project itself.
I dont know if this is because I have VS 2010 beta!
10/19/2009 9:10 AM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
ARD -- Are you using VS2010 beta 1 here? It isn't supported for SL3 development.
Gravatar
10/19/2009 9:12 AM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Hey Tim - No I am not using VS 2010. I am using VS 2008, however its installed on my machine.
10/19/2009 9:17 AM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
ARD - Seems like an odd error then, but could be related. I don't have that environment to confirm. Perhaps re-installing the Silverlight 3 tools might help.
Gravatar
10/19/2009 6:43 PM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Hey Tim - Finally after re-installing VS2008 everything works :) .... As you said all the problem was caused by SL3 Tools specifically KB967143...it was not getting uninstalled....
10/20/2009 9:59 AM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
I have created a new Silverlight Application, but I don't have any Views or Assets folders, any idea why? Did I miss out a step?
10/20/2009 10:04 AM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Sorry about that question. I saw your answer to the same question in a post above
10/22/2009 10:08 AM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World

hi there tim
new to silverlight getting main reason was air-america for their show then slip into my main desire cartooning or graphic novel creating. Found right off the bat. flickr4writer downloading this as I jot down this comment.
Can you lead me into the art of graphic novels with silverlight has anyone tried or done this?
kindly~ jimoer`i`ke`
10/22/2009 7:54 PM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
I am running Windows Vista. I have VS2008 and have installed Silverlight Tools for Visual Studio. I can create a simple "Hello world" type Silverlight app. (C# in this case) but:
have to re-size the XAML surface in order to see design surface.
design surface has message:
Load Cancelled
Loading of the visual designer was cancelled
(hyperlink to "Resume loading the designer"
when I click "resume reloading the designer", the design surface now appears but the "switch panes" is disabled, cannot drag and drop controls onto the design surface, etc.

Any light would beat the darkness

thanks.
10/22/2009 10:28 PM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Gary -- Sounds like you are using Silverlight 2? There is no editable design surface in VS2008 for Silverlight 3 development -- you cannot drag/drop controls. This is enabled in VS2010 (which is currently in beta 2)
10/23/2009 9:52 AM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Tim --
Ahh! I am, indeed, attempting to use SilverLight 3 with VS2008. I wish to continue to use VS2008. Can I install Silverlight 2 alongside my existing Silverlight 3? ("Can I" in the sense of 1) is it possible and 2) is it likely to work well? )

thanks.
10/23/2009 9:56 AM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Gary - Yes it is possible, but not entirely intuitive or streamlined. Read this: timheuer.com/.../...s-with-visual-studio-2008.aspx
10/24/2009 11:48 AM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
hi,Tim.
I am new.
when I tried to debug,I got a Error"The tag 'Expander' does not exist in XML namespace 'clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls'.
what's the matter?

thanks.
10/24/2009 12:01 PM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
wzy77cn - where are you using the Expander in this tutorial? I'm not using it. Regardless it is in one of the other Toolkit assemblies (layout I think).
10/24/2009 9:10 PM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Hi,Tim
thanks for you reply.

I created a new Silverlight Navigation Application project and kept all defalut settings,and then click DEBUG button,and then I got this error "The tag 'Expander' dose not exist" .The error is on File ErrWindow.xaml,line 21 and the error line code is '<controls:Expander Grid.Row="2" Header="Details" Margin="0, 10, 0, 0" >'.

thanks.
10/24/2009 10:07 PM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
wzy77cn - ah! i was looking in the wrong place. I forgot that the nav template uses toolkit controls in the ErrorWindow. Expander is a toolkit control. Make sure you have the Silverlight Toolkit (http://silverlight.codeplex.com) installed and this should resolve the reference. If you look at the project references I'm sure you'll see the warning next to a missing one.
Gravatar
11/2/2009 6:07 PM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World


Hi Tim,

Thanks for this great intro to Silverlight 3.0.
I just started the TwitterSearchMonitor project, following your instructions ( except one ;-) , I used a VB project) and when I run it, I get the error message below.
I use VS 2008 Team System and Windows 7 Ultimate.
Thanks
gm

Line: 56
Error: Unhandled Error in Silverlight Application
Code: 2104
Category: InitializeError
Message: Could not download the Silverlight application. Check web server settings
Gravatar
11/2/2009 6:16 PM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Tim,
I think I found the issue.
In the generated page "ErrorWindow.xaml.vb", in line 14 I changed the line

from:
ErrorTextBox.Text = "Page not found: \"" + uri.ToString() + " \ ""
To:
ErrorTextBox.Text = "Page not found: ' + uri.ToString() + ' "

It seems the escaping of the quotes is not correct in the generated page. This may be something for the SilverLight team to correct.

Thanks
gm
11/5/2009 7:44 AM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
hi,
didn't get views & assets directory.
how i can bring then in a application.
I see Shawn msg and sorry msg also but
didn't get idea.
please help
11/5/2009 8:27 AM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Alex - be sure you create the project with the Silverlight Navigation Application template as noted above.
11/9/2009 2:22 AM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Hi,
The content in this tutorial was very helpful.
11/13/2009 8:17 AM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
its crap
12/1/2009 10:37 AM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
this cool:
12/1/2009 2:45 PM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Hi Tim,

Thank you for the great tutorial. I am new at VS and Silverlight. When doing the tutorial, my Home.xaml screen doesn't look the same as yours. On mine the code text is black, and the intellisense isn't working. Any light you could shed on this issue? Thanks. I'm on Windows XP, VS 2008, Silverlight 3 Tools.
12/1/2009 3:04 PM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Heather -- did you successfully see the "Silverlight Aplication Template" though and created a project using that?
12/2/2009 7:34 AM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
I have installed everitying but the only template I can see is Silverlight Unit Test Application. where I can download the Navigator?
12/2/2009 10:03 AM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Simone -- make sure you install the Silverlight Tools for Visual Studio: http://go.microsoft.com/fwlink/?LinkID=143571 (as noted above)
12/2/2009 8:33 PM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Hi Tim,

Thank you for the tutorials. I ran into an issue while trying to install Silverlight Toolkit 3.
I currently have VS 2008 standard edition installed. When I try to install the
toolkit it says my Visual Studio 2008 Remote Debugger is not compatible. What do I have to do to bypass this issue?

Thanks,
12/3/2009 2:47 PM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Kareem -- send me a screenshot of this error you are seeing -- timheuer at microsoft dot com.
Gravatar
12/14/2009 9:25 AM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Hey Tim,

When I try to run the application I receive the Install Silverlight image instead of the application. I have Silverlight 3.0 installed. What might be causing this problem?
12/16/2009 9:44 AM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Hi Tim,

I currently have the Evaluation Build of Windows 7 installed, VS2008 with SP1, plus the silverlight tools, expression blend etc... I'm following the 1st steps of this which seem very straight forward, but when I execute the "Home.xaml" page as instructed, it gives me the following error:

Unhandled Error in Silverlight Application
Code: 2104
Category: InitializeError
Message: Could not download the Silverlight application. Check web server settings

I've already downloaded the Silverlight app and installed it - Could you point me in the right direction?

It seems this is a problem associated usually with IIS which I know nothing of, as well as to do with MIME types... Please help :)
12/16/2009 9:55 AM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Matt -- make sure you build the entire solution -- not just run the Silverlight application. The build task copies the XAP file to your web solution.
12/21/2009 10:22 AM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
good starting
12/29/2009 7:44 AM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Well started.
12/29/2009 9:56 PM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
hi tim,
i did all the steps you mentioned .. i added a button but its not visible wen i run the application
1/6/2010 11:56 AM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Hi Tim,
I'm an old hat programmer fumbling my way through learning Silverlight/C# and VS2010 beta. So far this is great! The only thing with VS2010 and VS2008 is that you have to pay attention to what is going on in your page and read ahead a bit.
Anyway, thank you!
1/12/2010 2:39 PM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Hi Tim,
Is it possible to have a single silver light page with in normal web application? I have a web site developed in VS 2008 and now the client wants the search results page to be in silver light.
Any idea?
Thanks,
Syed
1/12/2010 4:19 PM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
I created a Silverlight application with default settings. I made no change to it. When I try to run it using CTRL+F5, it gave me teh following error. What settinsg do I need to change to run the application succesfully.
==========================================================================

Unhandled Error in Silverlight Application
Code: 2104
Category: InitializeError
Message: Could not download the Silverlight application. Check web server settings
1/12/2010 5:57 PM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Sanwar -- make sure you compile the SOLUTION and not just the application.
1/12/2010 5:58 PM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Syed -- absolutely -- take a look at any of the many Silverlight sample applications and you will see that some of them integrate with the web app itself.
1/15/2010 4:37 PM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Hi Tim, after created application, it's only show me one application in solution explorer, Do I have to add TwitterSearchMonitor.Web nauually? Thanks
1/15/2010 5:00 PM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
multinet - you needed to make sure you chose the option to create a new web application for you.
Gravatar
1/17/2010 9:50 PM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Hi Tim,
I'm very new to this stage of web development. I'm thinking of going to collage to learn in greater depth. I've use FP and then went to EW I have created a few sites of my own (woodthings.biz & trimplus.biz) with these programs. Over the years I have learned as I use the programs, no schooling.
Anyways I am trying to follow your VWD 2008 tutorial and got stuck on where exactly I am supposed to add the line of code to change the word "Home" to "Hello World". The "void" function. Am I right to call "viod" a function?

Thanks

I really appreciate you web developers/designers taking the time to help us newbies out.
1/18/2010 6:36 AM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Hi Tim,

Great tutorial indeed, thanks :)

I have Silverlight 3.0 installed on VS 2008. Since, there is no editable design surface in VS2008 for Silverlight 3 development, is there any easy way to design UI? For instance, changing the style of Button, without having to run the application every time to check the output.

Is MS Expression Blend a good option?

Thanks,
Syed
1/19/2010 5:10 PM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
hi tim

thnx for your effort.
i have a stupid question

where do i put this code for the click button
void MyButton_Click(object sender, RoutedEventArgs e)
{
HeaderText.Text = "Hello World!";
}

thnx
1/20/2010 4:41 AM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
I liked it, i think silverlight is going to be much more fun...
Gravatar
1/21/2010 1:18 PM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Hi again Tim,

Like I said in my previous post I I've been learning as I use my software. I just wanted to let you know I figured it out. I created my project in VB instead of C#. Than I just played with it and figured out what and where to do the changes.

Thanks
Leo
1/26/2010 10:04 AM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Justin:

If you created your project in VB instead of C# and decided to use the Event Handler for the Click attribute, just go to your home.xaml file and right-click on Click="MyButton_Click" for a menu to pop up. From there, select "Navigate to Event Handler" to be taken to the Home.xaml.vb file. You'll automatically be placed in Private Sub MyButton_Click. Most of the code has already been input for you, and should look like this (in VB):


Private Sub MyButton_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs)

End Sub


From here, just type in HeaderText.Text = "Hello World!" between the Private Sub string and End Sub, so the completed code looks like this:


Private Sub MyButton_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs)
HeaderText.Text = "Hello World!"
End Sub


Save it, and when you hit F5 again to compile, you should get a working web page with a working "Click Me" button.

Keep in mind that this is for VB. I hope it helps!
2/3/2010 12:52 PM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
I have no Assets + Views folder, should I create them manually?
2/6/2010 5:34 PM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Hi there.

I've installed everything as mentioned, however when I open Visual Basic 2008 Express, my New Project dialog box is a choice of 6 options, with no additional windows as the screenshot shows.

I'm very new to all of this, so I'm a little stuck for what to do, as I've re-read the instructions many times.

Any help would be much appreciated.
2/10/2010 12:05 AM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Thank you for very nice article!!!
3/2/2010 10:43 AM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Hi I was trying to create silverlight application Could see all the project details, however, could not see the Assets and Views folder.

Am I missing some installation??
3/2/2010 10:53 AM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Be sure to start with the navigation application template as indicated above.
3/17/2010 11:13 AM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Hi Tim; Been trying to run several tutorials for Silverlight. I have run both scottGuBlog's tutorial and now yours. When I ran the first step of Scott's tutorial which consisted of adding a button to a blank page and running app in debug everything worked fine. Now ever since in both scott's tutorial and yours, everytime I try to run it, a web page opens with a label saying "Install Microsoft Silverlight". When I click the label the install fails saying "Silverlight is already installed", (which I knew). My Silverlight version is 3.0.50106.0. I am working in Visual Studio 2008 version 9.0.30729.1 SP. Any advice, suggestions or hints would be appreciated
3/17/2010 1:08 PM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Hi Tim writing to let you know That the problem turned out to be worse than I thought as the project that originally ran successfully was returning the same thing. I resolved problem by uninstalling silverlight runtime and toolkit and reinstalling them. I hope that this is not something that happens frequently with Silverlight tools and runtime.
3/25/2010 9:13 AM | # silvwrlight help
how do i redirect to another page by clicking a silverlight button.?
plz help.....
3/25/2010 3:16 PM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
deepak - use a HyperlinkButton and set the NavigateUri property.
4/5/2010 3:18 PM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Hello,
Im making some tests involving RIA applications and IDEs.
Dont know where to ask so here it is: will Visual Studio 2010 still needs Express Blend to deal with layout your RIA app?
4/5/2010 3:21 PM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Ronaldo -- you don't *need* Blend, but I think in most situations you will use both VS and Blend.
4/5/2010 3:42 PM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Hey Tim,

Thanks for the fast answer.
But if I don't use blend I will be doing the layout via code right? Like adding controls, etc?
What I'm doing is more like a re-search for the company I'm working - we just want to be sure if, to do the sort of layout of dropping some controls on a UI we going to need Blend or Visual 2010 will have a way to do that - just the way you do with Win forms applications, etc.
I've been trying Blend and its quite cool, really - but is way too much - we're not planning any complex layout - but we do want to use the power of RIA on our next gen app and we are 99.9% with .NET and Silverlight.
So the question is more like - to do my layout using the drag and drop approach for silverlight app do I need Blend or Visual Studio 2010 will have some sort of basic controls - you know, not the time line and all the cool blend stuff, but just the drag and drop.
4/5/2010 3:43 PM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
VS2010 includes an editable/drag/drop design time environment. It could be used for simple layout.
4/5/2010 3:54 PM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Hi Tim.
Great. Thanks for the answer.
I will still be playing with Blend at home finishing your tutorial.
4/14/2010 2:01 AM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
hi,tim:
can i develop silverlight 3 application with visual studio 2008 sp1 on windows server 2003 R2 with sever pack 2 operation system?

i had look over the system requirements of silverlight 3 Tools,it doesn't including windows server 2003 R2 with sever pack 2.
4/14/2010 8:31 AM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Nice tutorial, I really enjoy how simple and efficient it's explained. Can't wait to finish the rest. Thanks!!
4/15/2010 9:02 AM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Great. With over 5 years of experience in .NET development, I started with my Silverlight programming with your 'Hello World' program.

Tim, you you will be never gorgotten in my Silverlight endevours
4/15/2010 10:47 PM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
very much informative tutorial for me.
Being a starter i go a lot of learnings from this article.

Will appriciate more such learning examples. Thanks!!
Gravatar
4/28/2010 12:55 PM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
you need to show more code... i have no idea how to follow this
4/28/2010 12:59 PM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Ian -- in this step in particular it's VERY basic and all the code is shown here. You can download the solution to follow along or also see the video of this series to see more detail.
5/10/2010 8:44 PM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Hi Tim,

Plz dont laugh @ my question! :o(
I started step by step with your trail video it goes all perfect till I supposed to open the xaml file with expression blind but, I have not this option!!!
Should I install something or where I did a mistake! :">

Thanks in advance,
Ragen
5/24/2010 11:07 PM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Hi,
I want to publish a windows application that show network graphs and be visualize.
(that means nodes can move and etc.) do you think that silverlight can help me? do you help me until I choose a good tools to programming. my main application is writed with c#.
thanks,
mansoooreh
6/16/2010 6:23 AM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Hi,

i am new to VS.

I am trying to find out where i should write the code for the button.

1: void MyButton_Click(object sender, RoutedEventArgs e)

2: {

3: HeaderText.Text = "Hello World!";

4: }

I have already created the button.

Thanks
6/23/2010 2:06 AM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
i like this post very much as it helps me lot...keep writting
6/26/2010 9:20 AM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Thank you very much.. I am new to silverlight and your tutorial really helps!!!
7/7/2010 4:48 AM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Great tutorial, Many thanks..
<heads off to buy blend>
7/16/2010 2:33 AM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Good job Tim
Gravatar
7/18/2010 11:38 PM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
hi
i think i lost you in some point or something on this one, i downloaded all off the tools and other and started with dev express 2010, and i dont have the view and assets folder with my project where do find them?
7/27/2010 7:33 AM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
i like your proesentation thank you! when i started debuging F5 i got error like: unable to start debugging the silverlight developer runtime is not installed...... I m using vs 2010 trial.
also in a proior tutorial (not related to yours) I got error because Application.current.RootVisual was null.. this was the reason i looked for another tutorial like yours
7/28/2010 1:40 PM | # unhandled exception
after i tried to use express blend in part2 (actually i did not do anthing over there! ) and headed home, next day when i opened vs i get error like unhandled exception ... and i dont get my xaml in design view..
7/31/2010 5:36 AM | # Require xaml code for Angled datagrid column Header
Dear Tim

I am a Newbie and saw many of your posts in Silverlight.

I would request you to please help me with the exact code (In such a way that I can just paste it and achieve the requiored result in XAML ) for the "Angled Datagrid Column Headers like the one shown in the below two sites.

blogs.msdn.com/.../...ns-not-just-angled-text.aspx

mattberseth.com/.../...olumn_headers_with_sil.html

I am unable to achieve it with the same code in these sites as both sounds to be wrong(It gives error saying its not found and in Carla's code, I dont have the dll she use).

Please help me immediately or please write to me the exact code with, where should I paste it ( I mean, in resource file (App.xaml) or directly under which tag in my xaml view ? )

I just have some 10 columns in datagrid. I required these column headers to be angled and also, I would like to have background colour for the same. Please mail me the code or put it here. I need it damn urgently for my project please. Please please please :)

As I am a newbie, I understand, its very silly in front of folks like you. Please help.

ramakrishnan122001@yahoo.com is my email ID.


Thanks and Regards
Ram
9/28/2010 1:20 PM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
I am very new to this silverlight, I did install Silverlight, toolkit. I created a new Silverlight project by just following your instruction but I am stuck "Adding UI to the XAML pages". I don't see any About.xaml, ErrorWindow.xaml and Home.xaml.. am I missing anything ?
9/28/2010 1:25 PM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Found it .. when I create a new silver light project I shoudl select Silverlight Navigation Application.
9/30/2010 11:15 AM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Awesome. Thank you.
10/14/2010 4:44 AM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Hi Tim,
It's really a good tutorial. Can you pls tell me why i am not able to see the "Silverlight Navigation Application" Template under the silverlight project type.
Thanks.
12/9/2010 4:17 AM | # Speed up Pc
Thanks for this very useful info you have provided us. I will bookmark this for future reference and refer it to my friends. More power to your blog.
Speed up Pc
12/16/2010 1:57 AM | # noida packers and movers
Nice to be visiting your blog again, it has been months for me. Well this article that i've been waited for so long. I need this article to complete my assignment in the college, and it has same topic with your article.
1/7/2011 5:20 PM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
This is really cool... Kudos to all the developer specially to you Tim. You rock!!!
Truck Trailer Accessories
1/19/2011 3:19 PM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Okay guys. Here is my problem.
I start a silverlight application project and according to the tutorials
I should have a Page.xaml. I do not have a Page.xaml file. What I do
have is MainPage.xaml which I thought was the same, but according to the
tutorials I should be able to use the designer and access the toolbox
for the MainPage.xaml VBS file, but I am unable to do that and the toolbox
is empty.

What am I doing wrong or is that feature only available in Visual Studio
2008, 2010 Professional and not in the Express versions. Any help would be fantastic.
1/21/2011 3:41 PM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
I like the beginning which is explained very well but I prefer you stick with one sheet instead of bouncing back between xaml code and VB/or C# code.
Gravatar
2/5/2011 9:45 AM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
i don't like this fact but our web server environment uses only websites and not projects. the root of the site is a website and so it seems only subfolders can be websites. Since the subfolders inherit the roots web.config file. Anyway, can i use silverlight as a website or only as a visual studio project?

I hate to plow ahead with the project and then not be able to publish in a sub folder.
2/24/2011 10:11 PM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Great resource. Thanks for providing them. Question: do you know of any tool that will show when a link is coming from an image so you can count how many links come from image placement on various sites?
Go Seeq Search Engines
3/25/2011 5:46 AM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Hi!
i have small proplem.
i created Silverligt Application Navigation, tried Debug(F5), and have error:

"An unhandled exception of type 'System.AccessViolationException' occurred in System.Windows.dll

Additional information: Attempted to read or write protected memory. This often indicates that other memory is corrupt."

please help!
4/6/2011 3:15 AM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Just started with Silverlight and currently work on a small Hello world programm. It actually gets easier when you have a tutorial like this.

Thanks, Lisa from schmuck ratgeber
5/7/2011 8:34 AM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Great job!!!, It has been helpfull for me to start developing Silverlight.
9/26/2011 3:49 AM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Twitter is the best place of social networking...
Suchmaschinenoptmierung Agency
2/1/2012 2:38 PM | # re: Getting started with Silverlight: Part 1 - The tools and Hello World
Hi, I am all over the internet but can't find anything suitable though except the MEF only. I just want to learn about how to create a entrance page that user selects which language they prefer and then afterward the main page will be displayed with its navigation and everything. Could anyone please refer me to a good appropriate solution for this? THANKS

 
Please add 6 and 4 and type the answer here:

DISCLAIMER:

The opinions/content expressed on this blog are provided "ASIS" with no warranties and are my own personal opinions/content (unless otherwise noted) and do not represent my employer's view in any way.