public static string openFileDialog(string filter, string currentfile, string themeFile) { if (!File.Exists(themeFile)) { MessageBox.Show("To specify relative paths, select the platform with the theme.xml file", "Attention", MessageBoxButton.OK); return(null); } else { OpenFileDialog myDialog = new OpenFileDialog(); myDialog.Filter = filter; if (currentfile != "") { currentfile = SomeUtilities.MakeAbsolutePath(themeFile, currentfile); } if (File.Exists(currentfile)) { myDialog.FileName = currentfile; } myDialog.CheckFileExists = true; myDialog.Multiselect = true; //myDialog.InitialDirectory = tb_themefolder.Text; if (myDialog.ShowDialog() == true) { return(SomeUtilities.MakeRelativePath(themeFile, myDialog.FileName)); } return(null); } }