= wpfDialogBox = ~-<>-~ <> == Overview == '''wpfDialogBox''' is a Dyalog namespace containing methods to show dialog boxes in a WPF application. Check the comments of each method for more information. == Typical Usage == === To Query for a Folder === {{{ path←DialogFolder }}} {{attachment:DialogFolder.png || width=519}} === To Query for a File Name to Open === {{{ path←DialogOpenFile }}} {{attachment:DialogOpenFile.png || width=870}} === To Query for a File Name to Save === {{{ path←DialogSaveFile }}} {{attachment:DialogSaveFile.png || width=870}} === To Show an Error Message === {{{ response←ShowError 'This is an Error Message' 'My Program Name - Error' 'YesNoCancel' }}} {{attachment:ShowError.png || width=349}} === To Show an Information Message === {{{ response←ShowInfo 'This is an Information Message' 'My Program Name - Info' 'YesNoCancel' }}} {{attachment:ShowInfo.png || width=349}} === To Show a Warning Message === {{{ response←ShowWarning 'This is a Warning Message' 'My Program Name - Warning' 'YesNoCancel' }}} {{attachment:ShowWarning.png || width=349}} === Custom WPF Dialog Box === For a custom WPF dialog box you can consult the function `CustomMessageBox` <> {{{{#!wiki seesaw/CustomMessageBox/CustomMessageBox/hide {{{ CustomMessageBox;bitmap;icon;⎕USING ⍝ Prepare a Custom WPF Message Box ⎕USING,←⊂'System.Windows.Markup,WPF/PresentationFramework.dll' ⍝ Edit the wMsgBoxCustom_xaml file to suit your needs. MsgBox_obj←XamlReader.Parse(⊂wMsgBoxCustom_xaml) ⍝ Set the Custom Error Text (MsgBox_obj.FindName⊂'tbError').Text←'custom error text' ⍝ Set the Error Icon of the message box ⎕USING←'System.Drawing,System.Drawing.dll' 'System.Windows,WPF/PresentationCore.dll' 'System.Windows,WPF/WindowsBase.dll' ⍝ Possible choices are: Application Asterisk Error Exclamation Hand Information Question Shield Warning WinLogo icon←SystemIcons.Error ⍝ Change the Icon to a WPF bitmap bitmap←Interop.Imaging.CreateBitmapSourceFromHIcon(icon.Handle)(Int32Rect.Empty)(Media.Imaging.BitmapSizeOptions.FromEmptyOptions) (MsgBox_obj.FindName⊂'imgIcon').Source←bitmap ⍝ Show the Custom Message Box MsgBox_obj.ShowDialog wMsgBoxCustom_xaml