20 Steps to happiness
(This silliness assumes you haven't jumped into the beauty that is WPF development. It also assumes you're running Vista. If you aren't, why not? If you have a good reason, I'm betting you'll get help installing .NET Framework 3.0. on XPSP2)
- Go here
- Click on Visual C#
- Login with your Windows Live ID
- Download and click on all of the nessesary buttons
- Marvel at the small (~30 MB) download (if you don't get the data stuff).
- Type "Visual" in Vista's start menu.
- Marvel at the cool search feature
- Pick Microsoft Visual C# 9.0 Express Edition
- Marvel at our crazy long product names
- Pick "New Project..." from the start menu. (Ctrl+Shift+N to be super fast)
- Pick WPF Application.
- Marvel at the visual designer for WPF. (Thanks Cider team.)
- Open up the Toolbox and find the ListBox under Common Controls.
- Draw out a ListBox on the Window.
- Marvel at the XAML updating right away.
- Notice the auto-generated name for your ListBox: listBox1.
- Open up Window1.xaml.cs
- Paste the following below InitializeCompontent();
var foo = from a in Directory.GetDirectories(@"C:\") select new{a, a.Length};
listBox1.ItemsSource = foo.ToList();
- Marvel at:
-the use of "var" -- mmm...implicit types
-from/select in C# -- mmm...Linq goodness
-new {a, a.Length} -- mmm...anonymous types
.ToList() -- mmm...extension methods - Hit F5
WPF Goodness + VS "Orcas" design-time Goodness + Linq goodness = happiness
mmm...