none
Microsoft.VisualBasic.FileIO.FileSystem DeleteDirectory & DeleteFile

    Question

  • We have a custom File Open dialog in our WPF application.  From this dialog we allow the user to delete files and folders.  Internally we use Microsoft.VisualBasic.FileIO.FileSystem DeleteDirectory & DeleteFile so that we can send the deleted files to the recycle bin.  We set the UIOption to UIOption.OnlyErrorDialogs in these methods.  When an error occurs the dialog appears behind our custom file open dialog and is modal.  Does anyone have ideas on how to make this modal and popup on top of our dialog?

    Monday, February 08, 2010 9:39 PM

Answers

  • Try to delegate open filedialog operation to another form, but windowsForm, so the errors windows are over the wpf form.
    you can also open the formForm with owner parameter, so it always on top of wpf form and the the same, obvously, the dialog and the error windows.
    please, mark this as answer if it is THE answer
    ----------------
    Diego Cattaruzza
    Microsoft MVP - Visual Basic: Development
    blog: http://community.visual-basic.it/Diego
    web site: http://www.visual-basic.it
    • Marked as answer by SamAgain Tuesday, February 16, 2010 7:24 AM
    Tuesday, February 09, 2010 5:28 PM

All replies

  • Unfortunately, the My namespace is geared toward Windows Forms and does not recognize your WPF windows.

    Might it be possible to suppress the UI entirely and display your own UI in a Try/Catch when errors occur?  I realize that this is going to be more work for you.
    Tuesday, February 09, 2010 12:13 AM
  • Unfortunately it does not allow suppression of the UI.  That would be a great solution for me.  I will probably end up using the SHFileOperation.  The problem with going this route is that for Vista and above it has been replaced by IFileOperation which requires an OS version check and different code paths.

    Tuesday, February 09, 2010 2:45 PM
  • Try to delegate open filedialog operation to another form, but windowsForm, so the errors windows are over the wpf form.
    you can also open the formForm with owner parameter, so it always on top of wpf form and the the same, obvously, the dialog and the error windows.
    please, mark this as answer if it is THE answer
    ----------------
    Diego Cattaruzza
    Microsoft MVP - Visual Basic: Development
    blog: http://community.visual-basic.it/Diego
    web site: http://www.visual-basic.it
    • Marked as answer by SamAgain Tuesday, February 16, 2010 7:24 AM
    Tuesday, February 09, 2010 5:28 PM