Under System.Windows.Controls, I can see a PrintDialog However, I can’t seem to find a native FileDialog. Do I need to create a reference to System.Windows.Forms or is there another way?
Under System.Windows.Controls , I can see a PrintDialog However, I can’t seem to find
Share
WPF does have built-in (although not native) file dialogs. Specifically, they are in the slightly unexpected
Microsoft.Win32namespace (although still part of WPF). See theOpenFileDialogandSaveFileDialogclasses in particular.Do however note that these classes are only wrappers around the Win32 functionality, as the parent namespace suggests. It does however mean that you don’t need to do any WinForms or Win32 interop, which makes it somewhat nicer to use. Unfortunately, the dialogs are by default style in the “old” Windows theme, and you need a small hack in
app.manifestto force it to use the new one.