My First Day with Silverlight

Yesterday I decided to install everything I needed to start building Silverlight apps so I could see what it’s all about first hand. This post is an account of my first day experience being a Flash Developer and not knowing Visual Studio or any Microsoft Programming Language. I come from a Multimedia background so I was never really exposed to C# or C++ ever. If Microsoft is really serious about trying to get Flash Developers on board I think they are going to have to cater to people like me and not just their developer base.

 9am – Installing
I got into work and saw that Visual Studio had finished installing. So I went to the Silverlight website to see what else I needed to download. I looked at the list and saw downloads for the Beta and Alpha. So thinking that Beta comes after Alpha I downloaded everything with Beta attached to it. Fire up Visual Studio and stare at the Start Page still unsure what to do. Back to the website to watch that getting started video. Launch the video in Firefox and it’s next to impossible to watch. The video window is mega small and I can’t resize it. Try it in IE and still no dice. Feeling a little overwhelmed at first I call over our resident MS expert, Karl, and he begins to explain to be I need to install the Alpha. Apparently the Beta is 1.0 and the Alpha is 1.1. the difference is the Beta can only us Javascript and the Alpha C#. That was really apparent to me, but going back and actually reading the fine print it says it right there. Ok so back on track all the right things installed. I can now open Visual Studio and select Silverlight project from the list.

10am – Quickstarts
Started going through some of the quickstarts on the website. Going through the Event Handling one and went through creating a button. I created a TextBlock but couldn’t figure out how to set the font color. So I decided to open up the documentation and go through the language reference to see if I could figure it out, but I find out that the reference isn’t in the documentation. So I go through the Object Browser, this link will help you set that up, but it doesn’t give you any documentation there. So I continued on with the tutorials. I figured a good thing to do would be to start tracing objects and properties so I got Karl to show me how to use the Debugger. When I tried to debug for the first time it gave me a weird error saying it couldn’t find the file. The problem was that I had my project in a folder that had a space in the name. So make sure when building your apps that it goes into a directory without a space in it. Finally a project built. But no debug window. Apparently if you already have Firefox open and you debug it will run the app but not connect the debbuger. Time to save this post and continue writing in IE. Ok starting to feel a little more comfortable. I was able to figure out how to set the font color finally and was able to capture events. I have to say though my very little Flex experience is coming in handy with XAML.

11am-1130am
Figured out that the replacement for x and y properties is Top and Left.

1130am – 2pm – Lunch and meetings

2pm
Ok back on track.  Went through the quickstarts on creating Custom Components. It went pretty well expect if you are building the files from scratch it doesn’t go over some of the things you need to make it work. So be sure to always check out the source code of their examples if something isn’t working. Also learned some new syntax. So I think I need to get a book or something to start learning some C# code.

 3pm
Finally found some decent documentation on some of the Silverlight objects. I can’t help but feel that this should be called out a lot more then it is on the site. Or during the first couple of quickstarts have a note. “To learn more about the TextBlock object click here”. I figured out how to load an image in. It was pretty straight forward, but for some reason I couldn’t load one from our server. It’s probably a security thing. Going to look into that.

The rest of the day I spent just going through the Video Sample and installing Expressions Blend. I have to say considering my lack of C# knowledge is extremely low my first day was a success. My first impression is pretty good. Obviously I haven’t tried to do anything really crazy yet so I’ll save the Flash vs Silverlight comparisons until I actually make something. Better documentation and a better step by step guide for total newbies would be great. But again you have to remember it’s in Alpha so we just need to have some patience.

Continue reading » · Written on: 05-31-07 · 5 Comments »

5 Responses to “My First Day with Silverlight”

  1. Sean wrote:

    brilliant blog post especially for someone like myself who in the next few days will be sitting down and having a look at silverlight just as you have done. your notes and links will save me time. Thanks!

    May 31st, 2007 at 6:49 pm
  2. Freddie wrote:

    Thank you for sharing your experiences! I’m about to embark on the same from the same background and am trying to keep it all in perspective. I’ll get your rss in my netvibes and keep up on the progress.

    May 31st, 2007 at 8:59 pm
  3. mark wrote:

    you know how you can control quality by fixing something at the source…rather than (in a distributed workflow or system, for instance) have everyone at the breaking point fix it?

    same is true of the damned font color – it’s ridiculous that so many people will have initial problems with it; what would it hurt to include FontColor as an attribute (or COLOR or an intuitive FOREGROUND = ‘Green’)???

    i’m guessing the best way to set color is setting the FOREGROUND to a brush.

    how extremely intuitive.

    for one person.

    then there’s the rest of the world.

    that stuff drives me crazy.

    fix it at the source – just extend to allow setting of FontColor.

    June 6th, 2007 at 3:16 pm
  4. mark wrote:

    by the way – for those that read all the above & still need the help (since i didn’t see an answer either & this comes up first in Google when searching) here you go:

    MyTextBlock.Foreground = new SolidColorBrush(Colors.Black);

    June 6th, 2007 at 3:33 pm
  5. julian wrote:

    you can also do this if you want a custom color.

    SolidColorBrush sb = new SolidColorBrush();
    sb.Color = Color.FromRGB( r, g, b );

    myTextBlock.Foreground = sb;

    There is a couple more static Color methods that you can use like Color.FromARGB() as well.

    June 6th, 2007 at 4:20 pm

Leave a Reply