Charles Petzold



I Found the File Dialog Boxes

Working on Saturday, December 10, 2005
Roscoe, NY

After going around complaining that Avalon "doesn't even have standard File Open and File Save dialog boxes," I finally found them.

I apologize for bad-mouthing WPF. I promise I'll never do it again.

The OpenFileDialog and SaveFileDialog classes are hidden away in the Microsoft.Win32 namespace, which is where light wrappers around Win32 implementations end up. But I know these are the ones we're supposed to be using for our Windows Presentation Foundation apps because they're in PresentationFramework.dll, which is one of the major WPF assemblies.

Printing dialogs are also available in the form of PrintDialog and PageSetupDialog classes in the System.Windows.Controls namespace. Using PrintDialog I have successfully written a small Avalon app that caused my printer to eject blank pages, but that's as far as I've gotten.

So far, the only font-selection and color-selection dialogs I've seen have been sample code. I'm curious to see a good font dialog for Avalon because I tried writing one myself and it is not trivial.