Ok, so now I got Windows Vista RC1 installed (You can get it too from MSDN Subscriber Downloads) and I have the Orcas tools installed. I have been playing with Avalon since 2002 and it was announced as a "pillar of Longhorn" to all of you at the 2003 PDC but yet it seems to be a good time to start again for a couple of great reasons:
- The release of the.NET Framework 3 RC Orcas tools
- The release of the new bible of WPF, "Applications = Code + Markup", Petzold's book that will do the same for WPF what his "Programming Windows" did for Windows in the 80's and 90's
- The problems with it's so-called "Dynamic Layout" with WinForms 2.0 continue to plague us in our Smart Client development with way too much effort spent to position things and to really have a true dynamic layout engine. We can't rewrite everything for Avalon now but we can certainly start looking at hybrid approaches especially with certain third party vendors
- It's way too cool to ignore!!
So, here are the steps. I make no attempt to have this post be "novel" or "definitive"; just an attempt to put information in one place.
- Install Vista RC1 (Disclaimer: You can use XP SP2 and Windows Server 2003 but that's not what this post is about)
- In Vista, go to Control Panel | Programs | Turn Windows Features On or Off. Select the checkbox for "Microsoft .NET Framework 3.0." You probably want to turn on IIS while you are there. Reboot if necessary (mine didn't have to).
- Download the Windows SDK for RC1 of Windows Vista and .NET Framework 3. I recommend downloading and hosting the DVD ISO rather than taking your chances with the Internet install.
- Download and run the free Microsoft Virtual CD ROM Tool
- Mount the Windows SDK ISO
- The Autorun or Setup.exe will fail with a crash
- Navigate to the Setup subdirectory and run SDKSetup.exe
- At this point, you have enough to develop and run .NET 3 programs using the command line compilers and tools. This is actually the best way to learn a new framework and what I did to learn the .NET Framework 1 back in 2000-2001
- Install an edition of Visual Studio 2005 (optional). You may want to look at an Express edition if you are poor-).
- After that finishes, download and install the Microsoft Visual Studio Code Name “Orcas” Community Technology Preview – Development Tools for .NET Framework 3.0 (Optional but you want these if you use VS2005)
- Install the Microsoft® Visual Studio® 2005 Extensions for Windows® Workflow Foundation Release Candidate 5 (Optional)
You may also want to install, for later, AFTER you learn the basics:
Microsoft® Expression® Interactive Designer September 2006 Community Technology Preview
Microsoft® Expression® Graphic Designer September 2006 Community Technology Preview
Ok, now we're finally ready. I recommend, if you can, that you start with an editor and the command line compilers in the Windows SDK. I am using Notepad++ with its nice free syntax hilighting (I've given up on TextPad). As I said earlier, although VS2005 is very nice with its syntax hilighting, and WILL be what you use after the basics, it's wizards and such get in the way of really learning a new framework and learning with a book like Applications = Code + Markup. Like I said, the five editions of this book got me started programming Windows 2.0 in the mid-1980's and on through Windows 3.0 and 3.1. There was no Visual C++ or Visual Basic then. All we had was Petzold, a C compiler and an editor! In some ways, it was better because you really had to learn what you were doing. Of course, it wasn't very productive writing 175 lines of C code to put up a Window, you sure knew what the heck was going on.
Anyhow, fire up your editor, or use Visual Studio with the Orcas tools.
- Create a Windows Console Application
- Change the Project Properties to "Windows Application"
- Now, I/we need to learn what References are needed. My guess would be to first add PresentationCore and PresentationFramework and WindowsBase. System.Windows seems to be spread out over all three.
- That gets most of my "Avalon" program but I discover that I need to add System.Windows.Controls to add a TextBlock
using System;
using System.Windows;
using System.Windows.Input;
using System.Windows.Controls;
namespace Gentile.Avalon
{
public class DisplayTextBlockToMakeIanHappy : Window
{
[STAThread]
static void Main()
{
Application myApplication = new Application();
myApplication.Run(new DisplayTextBlockToMakeIanHappy());
}
public DisplayTextBlockToMakeIanHappy()
{
TextBlock ianText = new TextBlock();
ianText.FontSize = 32;
ianText.Text = "Hello Ian";
Content = ianText;
}
}
}
It looks like this (Glass and all!):
Now, you're ready for more!
Technorati Tags: Windows Presentation Foundation, NET Framework 3, WPF, Avalon, Microsoft
Posted
Sun, Sep 10 2006 11:04 AM
by
Sam Gentile