There is no such thing as ActualStartLocation in UWP when setting the folder to open the FileOpenPicker, and that is the reason for my question. There is a SuggestedStartLocation, but the Microsoft site clearly states:
"The SuggestedStartLocation is not always used as the start location for the file picker. To give the user a sense of consistency, the file picker remembers the last location that the user navigated to and will generally start at that location."
SuggestedStartLocation remembers where you were, and continues to open that same folder every time. As an example, add this code to the button click event in a UWP project:
FileOpenPicker openPicker = new FileOpenPicker();
openPicker.ViewMode = PickerViewMode.Thumbnail;
openPicker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;
openPicker.FileTypeFilter.Add(".jpg");
StorageFile file = await openPicker.PickSingleFileAsync();
if (file != null) {
TextBlock1.Text = "Selected Photo: " + file.Name;
} else {
TextBlock1.Text = "Operation cancelled.";
}
Now run the program and select a picture.
Close the program change the code to use MusicLibrary instead of PicturesLibrary.
Run the program again, and when you click the button, you'll be back in the PicturesLibrary, even though you asked to see music.
Is there a way to override this and force the location where the file picker will start? (ie: ActualStartLocation)
I am trying to make an app where the user selects a picture and a music file, and it would be nice if the picture picker always opened in the pictures folder and if the music picker always opened in the music folder.