hi,
based on a bool property in my view model i need to toggle a window (hide/show). i explicitly do not want to close it in order to keep its last location, size, etc. what is the best way to do this? binding the window's Visibility property seems to work for windows. but for dialogs the modal background stays visible (of course). one way would be to detect changes to the window's Visibility property, traverse up the visual tree until the wrapping Popup is found and toggle its IsOpen property accordingly in order to hide/show the windows including its modal background. however, i'm not sure if this popup is always present. and somehow this seems a bit hackish anyway. on another thread someone suggested to set the window's ModalBackground property to null. is this really a better solution? does it work in any case - inbrowser, OOB??? i'm not sure.
so???
thanks in advance,
stephan
based on a bool property in my view model i need to toggle a window (hide/show). i explicitly do not want to close it in order to keep its last location, size, etc. what is the best way to do this? binding the window's Visibility property seems to work for windows. but for dialogs the modal background stays visible (of course). one way would be to detect changes to the window's Visibility property, traverse up the visual tree until the wrapping Popup is found and toggle its IsOpen property accordingly in order to hide/show the windows including its modal background. however, i'm not sure if this popup is always present. and somehow this seems a bit hackish anyway. on another thread someone suggested to set the window's ModalBackground property to null. is this really a better solution? does it work in any case - inbrowser, OOB??? i'm not sure.
so???
thanks in advance,
stephan