We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 37602f2 commit 0f4911aCopy full SHA for 0f4911a
1 file changed
src/WPFDevelopers.Shared/Core/Helpers/Helper.cs
@@ -112,7 +112,19 @@ public static Uri ImageUri()
112
Uri uri = null;
113
var openFileDialog = new OpenFileDialog();
114
openFileDialog.Filter = "图像文件(*.jpg;*.jpeg;*.png;)|*.jpg;*.jpeg;*.png;";
115
- if (openFileDialog.ShowDialog() == true) uri = new Uri(openFileDialog.FileName);
+ openFileDialog.Multiselect = false;
116
+ openFileDialog.DefaultExt = ".jpg";
117
+ if (openFileDialog.ShowDialog() == true)
118
+ {
119
+ try
120
121
+ uri = new Uri(openFileDialog.FileName);
122
+ }
123
+ catch
124
125
+ throw;
126
127
128
return uri;
129
}
130
0 commit comments