Category Archives: Silverlight

Breaking news: Silverlight 1.0 Released!

Hot off the presses, Microsoft has released Silverlight 1.0! For those unfamiliar with Silverlight, it’s a lightweight add-in that works with most browsers. It allows you to display incredibly rich content in the browser. Version 1.0 uses AJAX libraries to handle multimedia content, games and more.

Read the Microsoft Press Release at:

http://www.microsoft.com/presspass/press/2007/sep07/09-04SilverlightPR.mspx

There is an interview with Scott Guthrie on Channel 9, you can see it here:

http://channel9.msdn.com/showpost.aspx?postid=339594

You can download Silverlight and learn more about it at the Silverlight site:

http://silverlight.net/Default.aspx

or the Microsoft page (slightly different content)

http://www.microsoft.com/silverlight/

Scott Guthrie has a really informative post on his blog:

http://weblogs.asp.net/scottgu/archive/2007/09/04/silverlight-1-0-released-and-silverlight-for-linux-announced.aspx 

If you want to see an example of a Silverlight site, visit the Alabama Code Camp site at:

http://www.alabamacodecamp.com/home.html

Sweet.

Advertisements

Arcane Stuff

Stepping away from WPF for a brief moment to pass along some interesting tidbits. First, there’s a new blog at Microsoft, the hackers blog. Should be interesting reading for those interested in security.

http://blogs.msdn.com/hackers/

Next, if you are one of the few people in the universe who has not yet heard, Scott Hanselman’s incredibly useful list of tools for 2007 is up.

http://www.hanselman.com/blog/ScottHanselmans2007UltimateDeveloperAndPowerUsersToolListForWindows.aspx

The Alabama Code Camp, which is scheduled for October 6th, has had it’s site updated. Note, it’s done in Silverlight, so you’ll need the latest Silverlight plug in to see it. (Don’t worry, the site will prompt you, quick and painless.)

You should also note there’s going to be a Silverlight Game contest. Design your own Silverlight game and you could win a Zune! See the site for details.

http://www.alabamacodecamp.com/

Finally, there’s an interesting looking conference going on in Nashville on October 12th and 13th called DevLink. They have some really big name speakers, with a really low admission. I’m planning on going, so maybe I’ll see you there!

http://www.devlink.net/

Starting a WPF Project

Head colds are nasty things. Yeah, I know folks like Scott Hanselman and Jeff Atwood say we shouldn’t talk much about ourselves, but I offer this as explanation for dropping off the face of the earth last week. A nasty head cold, followed by busy work week and my houses air conditioning dying in the middle of an Alabama triple digit heat wave… well something had to give.

But hey, odds are you’re not hear to offer your chicken soup recipe, but find out about WPF. So let’s kick this week off by starting a WPF project. Assuming you followed my instructions in my last post ( https://arcanecode.wordpress.com/2007/08/20/installing-the-wpf-bits/ ), you now have all the bits installed. Open Visual Studio 2005, and create a new project.

In your “New Project” window, navigate down to the “NET Framework 3.0” branch. In the templates area you see some new ones. One, WCF Service Library, is for creating Windows Communication Services projects and is outside the scope of this discussion.

The other three are WPF oriented projects. Windows Application (WPF) is for creating general windows applications using WPF. This is what you’ll probably use the most, and what we’ll pick for today’s demo. I named mine WPFSample001, as you can see above.

Before you click OK, let me just mention the other two. Custom Control Library (WPF) is analogus to it’s “old fashioned” WinForms counterpart. It lets you create a custom control comprised of WPF pieces for use in WPF Windows projects.

XAML Browser Application (WPF) is used to create a WPF App that will run inside a browser. Note this isn’t Silverlight. This is more like a Click Once deployment that opens the app inside the browser. MSDN (Sep 2007) had a good example of one you can see for yourself at http://ttpdownload.bl.uk/browserapp.xbap .

OK, that covers the various WPF project types. For today, we’ve decided on a standard WPF Windows Application, so click OK as you see in the screen above.

Let’s take a quick tour of what you see. Over on the left is the Toolbox. Under Common Controls, we see some with names look familiar. Button, CheckBox, Lable, etc. These are the WPF versions of the old Windows Forms controls. There are some new controls too, such as the DockPanel, the StackPanel, and a Grid which is unlike any Grid you’ve used in the past. We’ll get into these as time goes by.

Over on the right, in the Solution Explorer you see the Files that make our WPF project. App.xaml (and it’s corresponding App.xaml.cs) is the starting point for our Windows WPF app. Here you can respond to events like application starting and stopping, or you can blissfully ignore it.

The Window1.xaml is your main focus now, since it’s where you can do all your work. If you look at the center pane, you’ll notice it’s a bit different from traditional Windows Forms or even ASP.Net designer, in that it gives you the nice split screen. Changes in one are reflected in the other.

If you don’t like the split, you can modify it by either moving the mouse in the middle area and adjusting where the spit occurs, or manipulate it using the controls on the right side of the tab area:

The left most button flips the split from the default horizontal to a vertical one, nice if you have a really wide screen monitor. The middle button returns the split to the default horizontal orientation. The right most button removes the split all together, putting two tabs at the bottom (one for designer, one for xaml), not unlike the experience you get today when designing ASP.Net html pages.

Before I close out today, I want to mention that the designer tool under 2005 is not fully baked. You will see a lot of “whoops” screens appear. In addition, control placement is more like the ASP.Net experience than WinForms. As such, most folks I’ve seen so far prefer to type the XAML code directly in.

To start with I’ll be doing just that, typing in the XAML which will help me learn the behind the scenes syntax. Later I’ll shift to using the Expression Blend tool as the main XAML designer.

This is a good start, tomorrow we’ll pick up with creating a simple XAML app.

The UI of the Future

At yesterdays IPSA meeting (http://ipsaonline.org) our local MVP Todd Miranda (http://www.nxtdimension.com/blog/) gave a great presentation on XAML. My coworker Bin and I both felt it was an hour of our time well invested. I don’t know of many other ways we could have learned as much with the same investment of our time.

Coincidentally just yesterday I was in the book store and picked up a book on AJAX (Introduction AJAX for ASP.Net by Dino Esposito). Not too long ago we rolled out the AJAX for ASP.Net libraries on all of our ASP.Net servers, and I’ve wanted to dig into it.

It got me to thinking about user interfaces and the technology we used to create them. Not too long ago it was all text based. Just recently we showed a young collegue and old DOS based application still in use. Her reaction was “Did people actually used to use that?”

Windows made it better, with a standard set of controls that we could easily drop onto our forms. As Todd pointed out in his presentation today though, any attempt to change the basic appearance of these items could take thousands of lines of code.

With the introduction of XAML, I firmly believe we are on the verge of a new revolution in user interface design. It seems to have been a bit slow to start, but all it will take is that one “killer app” done in XAML to rock the boat. The recent introduction of Silverlight (formerly WPF/E) and it’s use of XAML will only serve to increase it’s popularity.

So where will we be in 10 years? I think under the covers compilers will be generating a lot of AJAX code, but I’m not so sure that we’ll be coding a lot of Javascript to deal with it. I feel a lot will be handled for you.

Of the two, right now I’d say XAML will be the more predominant player. I think the code generation tools will improve, but I feel a good, basic understanding of what’s going on with XAML will be crucial to every developer.