static public string OpenFolder() { DXFolderBrowserDialog dialog = new DXFolderBrowserDialog(); if (dialog.ShowDialog() == false) { throw new Exception("Folder is not selected"); } return(dialog.SelectedPath); }
void AssociatedObject_DefaultButtonClick(object sender, RoutedEventArgs e) { var dialog = new DXFolderBrowserDialog() { ShowNewFolderButton = false }; var result = dialog.ShowDialog(Application.Current.Windows.Cast <Window>().Last()); if (result.HasValue && (bool)result) { AssociatedObject.EditValue = dialog.SelectedPath; } }