Building Silverlight Applications using .NET

I'm just about to hop on the flight back to Seattle after finishing up a 10 day business trip to Europe where I spoke at conferences and user group events in Budapest, Amsterdam and Zurich.  Although trips like these are a little exhausting, I find them really valuable as a way to connect with developers from around the world, as well as provide me the opportunity to create and deliver new presentations and samples.

One of the talks I delivered on this trip was a new "Building Silverlight Applications using .NET" talk that people seemed to really like. 

Building Silverlight Applications using .NET Talk

I tried to keep the format and samples in this talk simple, and used a model where I used a few slides to explain each programming model concept in Silverlight, and then showed a very simple sample for each concept that helped demonstrate concretely how it worked.

In the talk I covered:

  • XAML
  • Using Shapes and Text
  • Using Controls
  • Layout (Canvas and Layout Managers)
  • Brushes
  • Transforms
  • Handling Events and Writing Code
  • Building Custom UI Controls
  • Reaching out and Programming the HTML of a page from a Silverlight control
  • Handling HTML Events in Managed Code (e.g. html button click handled in C#/VB on the client)
  • Exposing managed APIs to HTML JavaScript in the browser
  • Using the File Open Dialog support
  • Using the HTTP Network APIs
  • Using the Web Service APIs
  • Isolated Storage for local data caching

The slide deck comes to 83 slides - but I think does a good job of explaining everything step by step (it is also an easy deck to read - so even if you don't want to run the samples locally I'd recommend taking a look through the deck since I think you'll find it useful).  You can download the slides + demos of this talk below:

Included in the .zip download are readme instructions on how to run all of the samples on your own machine.

Quick Answer to a Common Question about .NET with Silverlight

One of the most common questions I received when giving the talk was - "do I need to have the .NET Framework installed in order to use Silverlight?".  The answer to this is no - a cross platform version of the .NET Framework is included in the 4MB Silverlight 1.1 download, which means you do not need to have anything extra installed on the client in order to program Silverlight with a .NET programming model in the browser. 

The Silverlight version of the .NET framework includes the same CLR engine (same GC, type-system, JIT engine) that ships with the full .NET Framework, and a subset of the .NET Framework namespace libraries.  You can see the full list of all classes/namespaces that are included by opening up the Object Browser when you create a new Silverlight application using Visual Studio (click here for a sample screen-shot of this).

People are usually pretty stunned/confused to hear that it is possible to get this much stuff in so small and quick an install package.  Let me just say it wasn't easy. <g>

Other Silverlight Talks and Blog Posts

For a broader overview talk of Silverlight, as well as some cool (more complete) samples you can download, please check out my previous "Lap Around Silverlight" talk and blog post here.  You can learn even more about Silverlight from my summary post here.  And you can watch me build a Silverlight application using .NET from scratch in this video here.

The talk above borrowed a number of slides from a few other Silverlight and WPF/E talks that others and I have given (although almost all of the code samples I showed in my talk are new).  In particular, my WPF/E talk from earlier in the year, Jamie Cool and Nick Kramer's Two Talks at MIX, and Stefan Schackow's Extending the Browser Programming Model with Silverlight talk at MIX.  You can watch Jamie, Nick and Stefan's talks online (along with all of the other MIX talks) for free here.

Hope this helps,

Scott

35 Comments

  • That's awesome. Thanks. We are just to do research on Silverlight at work, so this comes in handy.

  • Is there a video of the event?

  • I guess Office 2003 format files saved by Office 2007 are so big for they contain both Office 2003 and 2007 format data. If there're a lot of smart arts in the file, they will be saved as bitmaps for Office 2003 compatibility and use a lot of space.

  • Awesome Scott, thanks for making those slides available for download, I am looking forward to watching them tonight.

  • Hi Scott,

    When are you coming back to the UK? Your talks at WebDD went down a storm!

    - Granville.

  • Nice, very nice. I think this will be a great way for people to get in on cross-platform .NET/CLI development.

  • Sooo, what's in the MS.Internal namespace? ;-)

  • What happens when you put controls from System.Windows.Controls on your canvas? Wil they look like regular controls? Does that follow your theme? How do they look on the Mac, like native controls? Is there something like skinning? If .NET 3.5 is released with new classes in any of these namespaces, will they become available in Silverlight (are they in sync) or is that then postponed to Silverlight 2? If that's the case, wouldn't Silverlight be more of a .NET fork with a risk of the namespaces growing apart?

    Wow! That's like almost 10 questions, hope you'll answer them, thanks!

  • Scott, how about doing a screencast of your presentation?

  • Hi Scott, thank you so much talking here, it was interesting not only from the technical view but also to see the man doing that much stuff - we thought this blog are writing some other folks, so a big wow it comes from you alone :o)!

    Bye,
    Andrej

  • You mentioned that a cross platform version comes with Silverlight. Can we expect a full blown cross platform version in the not so far future, so that we developers can finally target other OSes using the .NET Framework?

  • I really enjoyed your talk on Silverlight in Amsterdam. When I returned to work the next day, I told my collegues about this new innovation. I'm hoping I can make management as enthousiastic as I am about Silverlight. I really think this is a great opportunity for our customers! Thank you!

  • Hi Scott,

    I attended your talks in Amsterdam.
    Now i want to show my collegues some demos you showed us but i cant find them on the net.

    Do you have a URL for :
    Top Banana
    Silverlight Jigsaw

    Thanks in advance

  • Thank you very much Scott. I was just started researching on Silverlight and .Net 3.0 I think your samples will help me. i am facing issues with opening .XAML files in VS2005 (i installed the VS extension for 3.0) Could you please give me your thoughts ??

  • Hi Scott,

    I went to your talk about Silverlight in Amsterdam. And even my friend who is definatly NOT a Microsoft fan,( and other students i told about it ), were really impressed about it. So i hope it will be the next big think in web-development.

    btw, are you going to ship Silverligth with Vista SP1, that would be very nice for the spreading of the software.
    All so you promised that Siverligth will be installed very quickly and yes, it does, I installed it in 4!!!! seconds. Something where adobe and others can learn a lot from :).

    Jorrit Posthuma
    ( Sorry for my bad English )

  • Great talk, Scott. I'm getting really stoked about Silverlight, except there's one fly in the ointment... We need low-level socket support for it to be useful to us. Add that and my entire development group will switch over from Flex tomorrow--no joke. Who do I need to bribe?

  • Hi Ullas,

    Do you have the Silverlight tools alpha installed on top of VS "Orcas" Beta1? You need this installed, since it supports the specific dialect of XAML that Silverlight uses.

    Thanks,

    Scott

  • Hi Jorrit,

    Glad you enjoyed Silverlight! :-)

    Thanks,

    Scott

  • Hi Josh,

    We'll support sockets with Silverlight 1.1 - so hopefully that will make your development groups day! :-)

    Thanks,

    Scott

  • Wow, thanks! If I'd known it would be that easy I'd have asked for a few more things, like bitmap effects, for instance :-)

  • this is reallly! cool thanks a lot!

  • Hi Scott,

    I saw you at the TechED 2007 Events. Truly inspiring! Just to let you know.

    best regards,
    Bram.

  • Scott, we are investigating the possibility of using Silverlight in an ASP.NET application for some analysis/reporting needs. What support does Silverlight provide for printing needs?

  • I would like to know if there's a way one can remove the default link that Silverlight points too when it detects the client needs the download it to avoid connecting to the internet in case of a Silverlight application deployed to an intranet.

  • Hi Scott,

    Is it possible to access the directX stack from silverlight code?

    this scenario will realy offer very intersting/advanced possibilities on the windows/silverlight platform

    Keep up the cool work.

  • Hi Charles,

    You can't use directx within Silverlight because Silverlight is designed to be cross platform - and DirectX is only supported on Windows. You can, though, integrate DirectX with WPF with teh full .NET Framework.

    Hope this helps,

    Scott

  • I here you clearly scott on the cross platform issues, but to be fair to the windows community, dont you think silverlight should be able to identify its host and then possibly, enable the use of other OS specific features like DirectX in question.

    True we can build WPF-directX styled apps, but i still see the motivation for silverlight to take advantage of existing powerful host specific features like DirectX on windosws.

    Case in point: Silverlight-DirectX features in a corporate web portal or bundled in a web application ment for use in a controled (windows environment)

    Just a thought.

    Regards,

    Charles Okwuagwu
    Paperless Solutions

    Lagos, Nigeria

  • Hi Scott

    I have been desperately searching for how use the silverlight fullscreen feature in my 4th year web project. My project is a GIS website built in VS2005 and i wish to integrate a button onto the masterpage allowing the user to turn the entire page into fullscreen mode. Is there a way to integrate this silverlight fullscreen feature into my VS2005 web project. Thank you kindly for any assistance in this regard.

    Devin

  • Hi Dev,

    Here is a blog post I've done that covers moving into full screen mode: http://weblogs.asp.net/scottgu/archive/2007/05/17/tip-trick-supporting-full-screen-mode-with-silverlight.aspx

    Hope this helps,

    Scott

  • Hi Sailung,

    The best bet for this question is to post on the forums on http://www.silverlight.net. There are a bunch of experts there who should be able to help.

    Thanks,

    Scott

  • Hi Scott,

    I've seen a number of posts where people are asking if there will be Webcam support within Silverlight, but I have yet to see an official MS response.

    Is there any print support (now or planned) within Silverlight ?

    Thanks

    Steve

  • Hi Steve,

    Webcam support is not supported in Silverlight 1.0 or 1.1 today. It won't be added to 1.0 before it ships this summer. We will support it at somepoint in the future though.

    Hope this helps,

    Scott

  • Typo on slide 65 of "Building Silverlight applications using .NET"... "available" is spelled "availble".

  • Where do you find installation tips for adding Expression Blend to Orcas. I have both installed and added Expression Blend as a tool to Orcas. I saw your demo video where you right clicked on the Silverlight xaml file to execute Expression Blend from Orcas. I don't have that. I have to use the Tool drop down. When I try to enter Expression Blend and load the project it says invalid xaml file. "<Canvas" not defined in namspace https:\\schemas.microsoft.com\client\2007. Same with "<TextBlock".
    Then re-entering Orcas it says it can't open project. I put the xml from the readme file in the expression blend directory.

    Otherwise looks like an exciting tool.

  • Trying to get the samples working with the Silverlight v1.1 Alpha release and Visual Studio 2008 "Orcas" Beta 2, I found that I needed to open the web.config in the samples Web Application project and change all the versions for .NET assemblies from 2.0.0.0 to 3.5.0.0 - this is apparently because Orcas includes the .NET 3.5 beta framework. If I didn't do that, I got a missing reference to System.Web.Extensions when I tried to run the samples web app. Hope this helps others.

Comments have been disabled for this content.