To use the FolderBrowseDialog is very easy. All of you who have used the FolderBrowserDialog from WinForms won't see a lot of differences.

How-To-Use
  1. Create an instance: {WPF_Dialogs.Dialogs.FolderBrowseDialog f = new WPF_Dialogs.Dialogs.FolderBrowseDialog();}
  2. Call the showDialog():
    1. As a normal function: f.showDialog();
    2. or as a function with return: WPF_Dialogs.EDialogResult result = f.showDialog();
#check the result:
  1. As a normal function: if(f.DialogResult == WPF_Dialogs.EDialogResult.OK) { do something }
  2. As a function with return:
    1. with variable: if(result == WPF_Dialogs.EdialogResult.OK) { do something }
    2. direct call: if(f.showDialog() == WPF_Dialog.EDialogResult.OK) { do something }

Differences between my FolderBrowseDialog and the WinForms FolderBrowserDialog
  1. Similar to the WinForms, but 2 differences: my class is called "FolderBrowseDialog" without an 'r' at the end of Browse and it has of course another namespace.
  2. The WinForms FolderBrowserDialog calls a "ShowDialog()" with a big 'S' and I with a small 's'. That's why I'm calling the original "ShowDialog()" of the Window-Class, but I've to change sth. like the returntype.
    1. and
    2. are all the same in WinForms
  3. although like the WinForms FolderBrowserDialog

Last edited Mar 14, 2010 at 10:38 AM by Sharpdeveloper, version 2

Comments

No comments yet.