Common file dialogs new properties by miloush · Pull Request #7916 · dotnet/wpf (original) (raw)
Implements #7689. Based on #7244. (Summary of missing features #7248)
To review the new properties in this PR, see only the diff from the folder dialog PR:
miloush/wpf@FileDialog-PickFolders-Breaking...FileDialog-NewProperties
Description
This PR adds several of the missing properties of the common file dialog API:
CreateTestFile
(FOS_NOTESTFILECREATE
)ForcePreviewPane
(FOS_FORCEPREVIEWPANEON
)AddToRecent
(FOS_DONTADDTORECENT
)ShowHiddenItems
(FOS_FORCESHOWHIDDEN
)ClientGuid
(IFileDialog.SetClientGuid
)DefaultDirectory
(IFileDialog.SetDefaultFolder
)RootDirectory
(IFileDialog2.SetNavigationRoot
)
The changes from the originally approved API are:
ShowHiddenItems
instead ofShowHiddenFiles
, following the disunification ofFileNames
andFolderNames
AllowReadOnlyItems
is dropped. It can only be enabled forOpenFileDialog
, it cannot be disabled forSaveFileDialog
. Users wishing to disallow read-only items inOpenFileDialog
can use theFileOk
handler instead.
Testing
Compiled and tested on 8.0.0-preview.3.23174.8. Verified each property has an observable effect and is defined in an appropriate class.
Risk
These are all new properties. DefaultDirectory
and RootDirectory
could technically be shell items rather than strings if the dialog is to support shell items in the future, but so could InitialDirectory
which is already present as string. The current use case is strong enough and the strings are allowed to be shell item parsing names anyway.
/cc @dipeshmsft