wpf - Is it possible to re-show and closed dialog window? -
some context here...i have system.windows.window used display modal message box. created show() method initializes content of window, , calls showdialog(). user clicks button on window, information clicked button set in tag property, , window closed via close().
as expected, showdialog exception when attempting call showdialog() on window once has been closed. there way reuse same window instance don't have new instance every time need message box?
for example...
messageboxwindow mbw = new messageboxwindow(); result = mbw.show("caption", "message 1"); mbw.show("caption", "message 2"); // above throws exception, have this... mbw = new messageboxwindow(); result = mbw.show("caption", "message 2");
any appreciated!
use .hide() instead of .close(). removes without destroying it. can call show() again when needed.
mainwindow test = new mainwindow(); test.show(); test.hide(); test.show();
Comments
Post a Comment