Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Common file dialogs new properties #7916

Merged
merged 22 commits into from
Jul 7, 2023

Conversation

miloush
Copy link
Contributor

@miloush miloush commented Jun 12, 2023

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 of ShowHiddenFiles, following the disunification of FileNames and FolderNames
  • AllowReadOnlyItems is dropped. It can only be enabled for OpenFileDialog, it cannot be disabled for SaveFileDialog. Users wishing to disallow read-only items in OpenFileDialog can use the FileOk 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

Microsoft Reviewers: Open in CodeFlow

@miloush miloush requested a review from a team as a code owner June 12, 2023 21:09
@ghost ghost assigned miloush Jun 12, 2023
@ghost ghost added the PR metadata: Label to tag PRs, to facilitate with triage label Jun 12, 2023
@ghost ghost requested review from dipeshmsft and singhashish-wpf June 12, 2023 21:09
@ghost ghost added the Community Contribution A label for all community Contributions label Jun 12, 2023
@miloush miloush mentioned this pull request Jun 12, 2023
24 tasks
@miloush miloush mentioned this pull request Jul 2, 2023
@dipeshmsft dipeshmsft merged commit 788581f into dotnet:main Jul 7, 2023
8 checks passed
@ghost ghost locked as resolved and limited conversation to collaborators Aug 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Community Contribution A label for all community Contributions PR metadata: Label to tag PRs, to facilitate with triage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants