First time I\'m implementing a FolderBrowserDialog in WPF and I\'m not loving it one bit...
Aside from the issues I had figuring out that Windows.Forms wasn\'t refer
DialogResult is an enumeration and defines values to indicate the return values of dialogs.
In your code you should check for DialogResult.OK
to init your variable with the path selected in the dialog. DialogResult.OK
is returned when the "OK"-Button is pressed in the dialog, otherwise is DialogResult.Cancel
returned.
if (result == DialogResult.OK){
txtSource.Text = fbd.SelectedPath;
}