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

Published Tuesday, June 19, 2007 6:15 AM by ScottGu

Comments

# Building Silverlight Applications using .NET - ScottGu's Blog

Pingback from  Building Silverlight Applications using .NET - ScottGu's Blog

# re: Building Silverlight Applications using .NET

Tuesday, June 19, 2007 10:46 AM by Balazs Fejes

I've also published part 1 of the discussion with Scott at the Budapest REMix'07 event, you can listen to it at fb2.hu/.../x10.php - we appreciate your visit, Scott.

# re: Building Silverlight Applications using .NET

Tuesday, June 19, 2007 10:46 AM by Chad Campbell

This is great!  Thank you so much for posting this content.

# re: Building Silverlight Applications using .NET

Tuesday, June 19, 2007 10:52 AM by Mads Kristensen

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

# re: Building Silverlight Applications using .NET

Tuesday, June 19, 2007 11:20 AM by Juan maría

Hi Scott:

You can read this in spanish here:

thinkingindotnet.wordpress.com/.../creando-aplicaciones-silverlight-con-net

# re: Building Silverlight Applications using .NET

Tuesday, June 19, 2007 11:23 AM by L. Tauber

Is there a video of the event?

# re: Building Silverlight Applications using .NET

Tuesday, June 19, 2007 11:31 AM by Cat Chen

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.

# re: Building Silverlight Applications using .NET

Tuesday, June 19, 2007 11:52 AM by Josh Stodola

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

# Aaron&#8217;s UI Design Blog &raquo; ScottGu talks about Silverlight

Pingback from  Aaron&#8217;s UI Design Blog &raquo; ScottGu talks about Silverlight

# re: Building Silverlight Applications using .NET

Tuesday, June 19, 2007 2:28 PM by Granville Barnett

Hi Scott,

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

- Granville.

# re: Building Silverlight Applications using .NET

Tuesday, June 19, 2007 2:37 PM by orcmid

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

# re: Building Silverlight Applications using .NET

Tuesday, June 19, 2007 2:57 PM by Mike

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

# re: Building Silverlight Applications using .NET

Tuesday, June 19, 2007 3:08 PM by Mike2

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!

# F??bio Pedrosa &raquo; Even more Silverlight content&#8230;

Tuesday, June 19, 2007 4:17 PM by F??bio Pedrosa » Even more Silverlight content…

Pingback from  F??bio Pedrosa    &raquo; Even more Silverlight content&#8230;

# re: Building Silverlight Applications using .NET

Wednesday, June 20, 2007 12:08 AM by Matt S

Scott, how about doing a screencast of your presentation?

# re: Building Silverlight Applications using .NET

Wednesday, June 20, 2007 12:13 AM by Vikram

One very important question. Currently Silverlight does not support windows 2000 server. Is the next version going to support windows 2000. if yes then By when can I expect that. Most of the people to whom I want to show the demo uses windows 2000. Also while developing silverlight in the SERVER, what framework of dot net do i need in the server side.

Thanks

Vikram

www.vikramlakhotia.com/HomePage.aspx

# re: Building Silverlight Applications using .NET

Wednesday, June 20, 2007 1:33 AM by Andrej Macko

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

# re: Building Silverlight Applications using .NET

Wednesday, June 20, 2007 2:35 AM by Twan

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?

# re: Building Silverlight Applications using .NET

Wednesday, June 20, 2007 3:09 AM by Michael

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!

# re: Building Silverlight Applications using .NET

Wednesday, June 20, 2007 3:32 AM by Vincent van der Laan

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

# re: Building Silverlight Applications using .NET

Wednesday, June 20, 2007 7:49 AM by Ullas

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 ??

# re: Building Silverlight Applications using .NET

Wednesday, June 20, 2007 9:38 PM by herndon

Hi, Scott -- I reposted this at <a href="www.silverlightsaber.com/Default.aspx target="_blank">Silverlight Saber</a>.  I think this will come in handy for other developers; thanks for adding it.

# re: Building Silverlight Applications using .NET

Thursday, June 21, 2007 3:25 PM by Jorrit Posthuma

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 )

# re: Building Silverlight Applications using .NET

Thursday, June 21, 2007 4:53 PM by Josh

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?

# re: Building Silverlight Applications using .NET

Thursday, June 21, 2007 5:32 PM by ScottGu

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

# re: Building Silverlight Applications using .NET

Thursday, June 21, 2007 5:33 PM by ScottGu

Hi Jorrit,

Glad you enjoyed Silverlight! :-)  

Thanks,

Scott

# re: Building Silverlight Applications using .NET

Thursday, June 21, 2007 5:33 PM by ScottGu

Hi Josh,

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

Thanks,

Scott

# re: Building Silverlight Applications using .NET

Thursday, June 21, 2007 6:52 PM by Josh

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 :-)

# re: Building Silverlight Applications using .NET

Friday, June 22, 2007 5:05 PM by Patrick

this is reallly! cool thanks a lot!

# Ken Rawlings &raquo; Blog Archive &raquo; Parallel Programming, Silverlight, and the RSS Bandit parser

Pingback from  Ken Rawlings  &raquo; Blog Archive   &raquo; Parallel Programming, Silverlight, and the RSS Bandit parser

# re: Building Silverlight Applications using .NET

Saturday, June 23, 2007 7:44 PM by Bram

Hi Scott,

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

best regards,

Bram.

# re: Building Silverlight Applications using .NET

Sunday, June 24, 2007 9:02 PM by Krishna Kumar

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?

# re: Building Silverlight Applications using .NET

Monday, June 25, 2007 3:18 PM by Román

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.

# re: Building Silverlight Applications using .NET

Tuesday, June 26, 2007 10:22 AM by Lorin Thwaits

Scott -- We're really excited to have you out to sunny Phoenix tomorrow!  For anyone in the area who hasn't registered yet, you can do so here:

http://azgroups.com/uber07

Videos will be published soon after the event.

# Mehr Silberlicht

Wednesday, June 27, 2007 8:16 AM by TechNet Team Blog Austria

Passend zu dem Beitrag von Toni Pohl zu Silverlight poste ich noch einige ergänzende Information. Silverlight

# re: Building Silverlight Applications using .NET

Thursday, June 28, 2007 1:51 AM by Charles Okwuagwu

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.

# re: Building Silverlight Applications using .NET

Thursday, June 28, 2007 2:48 AM by ScottGu

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

# re: Building Silverlight Applications using .NET

Thursday, June 28, 2007 5:47 AM by Charles Okwuagwu

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

# re: Building Silverlight Applications using .NET

Monday, July 02, 2007 8:07 PM by dev1l85

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

# re: Building Silverlight Applications using .NET

Wednesday, July 04, 2007 6:46 AM by Sailung

Hi Scott,

I try many times to call Server Methods from Javascript Function but it Couldn't. i have MouseUp Eventhandler which i had written in "Mybutton.xaml.js"

in that MouseUp  Eventhandler i call another JavaScript Function which is inline in aspx file the function name is <script type="text/javascript">

       function Myname()

       {

       var str = PageMethods.GetData();

       alert(str);

       }

   </script>

When i run in debug mode i see in line PageMethods.GetData() does not invoke server side function but when line goes alert(str) it invoke Server side function GetData() but the Dialog box appear Message "undefined". I am stuck in here to call server side function.

I have define script Manager which has include a loaded Script for Silverlight. I had also defined  EnablePageMethods="true"

Is there any idea to get rid out from this problem?

Regards

Sailung

# re: Building Silverlight Applications using .NET

Wednesday, July 04, 2007 4:26 PM by ScottGu

Hi Dev,

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

Hope this helps,

Scott

# re: Building Silverlight Applications using .NET

Wednesday, July 04, 2007 4:26 PM by ScottGu

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

# WPF Dev - Silverlight Application Basics, PowerPoint and Samples

Pingback from  WPF Dev -   Silverlight Application Basics, PowerPoint and Samples

# re: Building Silverlight Applications using .NET

Thursday, July 12, 2007 6:06 AM by Steve Wilkinson

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

# re: Building Silverlight Applications using .NET

Thursday, July 12, 2007 11:01 AM by ScottGu

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

# re: Building Silverlight Applications using .NET

Tuesday, July 17, 2007 1:50 PM by EricLaw

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

# Silverlight presentation material

Tuesday, July 24, 2007 10:58 PM by Laurent Duveau

Recently I was looking for Silverlight powerpoint to download in order to give a presentation in my company

# re: Building Silverlight Applications using .NET

Friday, July 27, 2007 12:30 AM by William A Phillips

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.

# Does Silverlight change 3 tier to 6 tier?

Thursday, August 02, 2007 6:40 PM by Jesse Liberty - Silverlight Geek

I received the following email... Maybe I am crazy but I see the creation of new design patterns around

# Visiting Microsoft India Campus

Friday, August 10, 2007 4:22 AM by Jason Zander's WebLog

I've spent this week visiting the Microsoft Campus in Hyderabad, India . On Wednesday I had a chance

# Playing with VSTS 2008 Beta 2 and SilverLight 1.1

Friday, August 10, 2007 7:23 PM by MikeKelly's WebLog

I've started playing around a bit with Visual Studio Team System Beta 2 release with SilverLight 1.1

# Playing with VSTS 2008 Beta 2 and SilverLight 1.1

Friday, August 10, 2007 8:26 PM by Noticias externas

I&#39;ve started playing around a bit with Visual Studio Team System Beta 2 release with SilverLight

# MSDN Blog Postings &raquo; Playing with VSTS 2008 Beta 2 and SilverLight 1.1

Pingback from  MSDN Blog Postings  &raquo; Playing with VSTS 2008 Beta 2 and SilverLight 1.1

# re: Building Silverlight Applications using .NET

Saturday, August 11, 2007 1:14 PM by Mike Kelly

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.

# Visual Studio 2008 "Orcas" Beta 2 and Silverlight

Saturday, August 11, 2007 1:19 PM by MikeKelly's WebLog

OK, have passed one hurdle in getting Scott Guthrie's Silverlight samples to work with VS 2008 Beta 2.

# MSDN Blog Postings &raquo; Visual Studio 2008 "Orcas" Beta 2 and Silverlight

Pingback from  MSDN Blog Postings  &raquo; Visual Studio 2008 "Orcas" Beta 2 and Silverlight

# Silverlight presentation material

Thursday, October 04, 2007 4:41 PM by Laurent Duveau

Recently I was looking for Silverlight powerpoint to download in order to give a presentation in my company