private void SetNativeDialogProperties(NativeFileOpenDialog nativeFileOpenDialog) { //Set Title if (!string.IsNullOrEmpty(m_Title)) { nativeFileOpenDialog.SetTitle(m_Title); } //Set Folder if (!string.IsNullOrEmpty(m_FolderPath)) { if (System.IO.Directory.Exists(m_FolderPath)) { nativeFileOpenDialog.SetFolder(CreateShellItemFromParsingName(m_FolderPath)); } else { string parent = System.IO.Path.GetDirectoryName(m_FolderPath); if (parent != null && System.IO.Directory.Exists(parent)) { string folder = System.IO.Path.GetFileName(m_FolderPath); nativeFileOpenDialog.SetFolder(CreateShellItemFromParsingName(parent)); nativeFileOpenDialog.SetFileName(folder); } } } //Apply option bitflags nativeFileOpenDialog.SetOptions(GetNativeDialogFlags()); }