PowerShell Presentation Framework - Part 4 (Good Layout Hygiene)

Time to take a break from PoSHPF specifics and take a bath. Our code is getting a little smelly, so let's talk about good layout hygiene.

Nathan Ziehnert

7 minute read

It’s been three posts since we’ve showered, and our XAML is starting to smell a bit. It’s time to practice some good hygiene. Thus far we’ve just dragged elements into our window and resized by hand. For the most part that has worked, up until we ran our last example. Our loon didn’t expand to the entire window and left some gross white space on the right side we need to scrub off. I said this in my MMS presentation, and I’ll say it again:

PowerShell Presentation Framework - Part 3 (Media Resources)

Now it's time to break into some of the content that makes PoSHPF unique. In this particular post we'll talk about what I call Media Resources. What I really mean is easy references to images or sounds without having to change their value in PowerShell.

Nathan Ziehnert

7 minute read

Alrighty, so now we know how to create a window and make a button do something. What about media like images and sounds? In C# you might embed the resource (image/sound) directly in your executable and reference it via an internal path reference. In PowerShell though, short of converting the file to a base-64 value there isn’t a really good way to store file content directly in your script. Nor should there be.

PowerShell Presentation Framework - Part 2 (Wiring Controls)

Now that we've got a basic GUI with a button and a label, let's talk about how to wire up these controls to actually do something!

Nathan Ziehnert

7 minute read

Today we’ll kick off Part 2 of the series on building WPF GUIs with the PowerShell Presentation Framework. We’re still in the beginning phases of our GUI building learning, so things will still be simple. I hope you kept a copy of your XAML from last time (the one where we created a label and a button). If you didn’t - here’s a solution you can launch in Visual Studio that has everything we need for today.