fix<FolderDialog>: using System.Windows.Forms.FolderBrowserDialog instead of Controls.FolderDialog to avoid crashes

This commit is contained in:
leo 2023-08-18 13:28:55 +08:00
parent 0dc73cbc0d
commit 12511007e3
7 changed files with 16 additions and 134 deletions

View file

@ -95,8 +95,9 @@ namespace SourceGit.Views {
}
private void OnFolderSelectorClick(object sender, RoutedEventArgs e) {
var dialog = new Controls.FolderDialog();
if (dialog.ShowDialog() == true) {
var dialog = new System.Windows.Forms.FolderBrowserDialog();
dialog.ShowNewFolderButton = true;
if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) {
Folder = dialog.SelectedPath;
txtFolder.GetBindingExpression(TextBox.TextProperty).UpdateTarget();
}