Featured Posts

Clatto Verata N... Necktie... I've been a fan of the Evil Dead franchise since I first saw the original back when I was about 16. What a fantastic series of movies, and I love each and every one of them....

Readmore

Clatto Verata N... Necktie... I've been a fan of the Evil Dead franchise since I first saw the original back when I was about 16. What a fantastic series of movies, and I love each and every one of them....

Readmore

Foam and Ghosts and Urethane...oh my! After much deliberation, hours of research and a handful of emails with http://www.smooth-on.com, I think I finally have a plan to build the kids proton packs for halloween. For...

Readmore

A Proton Pack is not a toy? "Are you troubled by strange noises in the middle of the night? Do you experience feelings of dread in your basement or attic? Have you or your family ever seen a spook,...

Readmore

Facebook Development - getting started While I'm learning silverlight behind the screen, I thought I'd put a little article together about setting up your development environment for the Facebook Development platform....

Readmore

Fickle Frank Rss

Starting with Silverlight

Posted on : 21-06-2009 | By : Fickle Frank | In : Silverlight

2

So I started looking into working with silverlight today and so far so good. I have to say, its pretty slick to work with. One hurdle I am going to have to overcome is working with xaml, which is the gui “language” that silverlight uses for its interfaces. So let me ease into this and start with a simple what you need and how to start a new project.

Ok so what do you need to work with Silverlight?
Well first you will need to download and install Visual Web Developer 2008

Then head over Silverlight Getting Started and download the run time.

Thats pretty much everything you need to get started.

Moving on, lets start a new project:
Ok, now that you have that all done, lets start up a new project. Just open Visual Web Developer (if you just installed and its your first time opening it its going to take a minute to set itself up). Once it’s open click File new Project.

New Silverlight Project

Make sure you name your project something that makes sense too. I’m going to name mine Example1, for obvious reasons.

Next its going to ask you what kind of project you want to use. Whether or not that should be an ASP.NET project loading the silverlight control you’re about to make, or if you want to load it in a basic HTML page (which VWD will create on the fly). I selected the HTML page container.

Once you’ve done this VWD will load up some standard files that you need to start a Silverlight Project. Specifically App.xaml and Page.xaml.

Page xaml is where you will do your gui layout, and Page.xaml.cs is where you will put all of your coding logics.

So first things first lets look at our new User control.

This is what we start with by default:

<UserControl x:Class="Example1.Blank"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Width="400" Height="300">
<Grid x:Name="LayoutRoot" Background="White">

</Grid>
</UserControl>

Now one problem with silverlight you are going to find is that you cannot use the Design editor to change things, everything is controlled within the xaml. I believe Expression Blend 2 takes care of this issue for us, but I don’t want to dive into that yet. 

As you can see from the xaml code my userControl is named Example1. The size of my control is 400 wide and 300 tall. I guess if you wanted to equate this to Flash this would be your “stage”. Inside the Control we start with a Grid element called “LayoutRoot” with a White background color. Everything you want to display will go inside this Grid element of the xaml. It  helps you with your layout by providing Rows and Columns to use, very handy for layingout your user interface.

Ok, so what do I want to do to make? 
I find that having a purpose and end goal always helps me learn. I find it difficult to learn by just reading and trying to absorb the information. In my opinion hands on is the best way to learn. (I think I just undermined my blog?)

So I figure I will start with a small simple project and since I am also newly anamoured with creating Facebook Applications, I would like to be able to work on something that people on facebook might actually use. So I need to come up with an idea so heres one thing I know:

People on facebook love apps that let them collect, share and display things about themselves.
(”it is a social environment afterall”) 

So I need to come up with an idea that will meet all three of those criteria in order to make something those faceybookers will use. Guess I better start brainstorming. Once I have an idea I will post again and share the plan with you.

As for tutorials I would really like to try my hand at screencasting them. But with 6 little me’s running around that might be difficult. So I am going to attempt to make the first tutorial a screencast once I have something to explain, but if things don’t work out I will at the very least post an explainatory textual tutorial with code samples of my progress.

For those out there that might read the future tutorials, that know Silverlight and C#, please feel free to point out any mistakes or errors I make during this learning process.

Alrighty! Let me say fairwell for now and get to learning some more of this Silverlight stuff so I can attempt to share it with you.

Comments (2)

Great post! I’ll subscribe right now wth my feedreader software!

Thanks much for that well written post.

Write a comment