internal void Open() { var ofd = new CommonOpenFileDialog(); ofd.Title = "Choose Directory"; ofd.IsFolderPicker = true; ofd.AddToMostRecentlyUsedList = false; ofd.AllowNonFileSystemItems = false; ofd.EnsureFileExists = true; ofd.EnsurePathExists = true; ofd.EnsureReadOnly = false; ofd.EnsureValidNames = true; ofd.Multiselect = false; ofd.ShowPlacesList = true; if (ofd.ShowDialog() == CommonFileDialogResult.Ok) { // Just assume the folder paths are valid now. var folderPath = ofd.FileName; m_editorCore.UnloadMap(); m_editorCore.LoadMapFromDirectory(folderPath); } }