Defining WPF with XAML
During our exploration of creating a Windows Presentation Foundation (WPF) PowerShell script, I've been taking a programmatic approach. That is, I've been creating instances of the relevant .NET classes in a PowerShell script, updating properties, defining events, and launching the script. I believe this is a good way to teach you how the works. Now that you understand the mechanics, we can move on and separate the form description with the code necessary to run the form. This is the WPF model.
XAML
The traditional approach is to define the visual elements of the form in a special XML format called XAML. You can pronounce it zamel. For our purposes, the XAML definition can be loaded from a file or embedded in the script file. The idea is that you can modify the layout or the code separately.
Here's a simple XAML file.