This is a migrated thread and some comments may be shown as answers.

How to hide (not close) window?

2 Answers 69 Views
Window
This is a migrated thread and some comments may be shown as answers.
Marc
Top achievements
Rank 1
Marc asked on 28 Jan 2013, 10:27 PM
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

2 Answers, 1 is accepted

Sort by
0
Ivo
Telerik team
answered on 31 Jan 2013, 06:00 PM
Hi Stephan,

I would agree that both solutions feel a bit hackish, but currently these are the only ways to hide modal RadWindows. Both approaches work for in-browser and out-of-browser applications. Setting the ModalBackground to null can be done using just a binding and, therefore, I believe it's easier to be understood by other developers. That's why I would chose it, but in fact this is a matter of personal choice.

All the best,
Ivo
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Marc
Top achievements
Rank 1
answered on 01 Feb 2013, 07:48 AM
Alright, thank you for your answer.
Tags
Window
Asked by
Marc
Top achievements
Rank 1
Answers by
Ivo
Telerik team
Marc
Top achievements
Rank 1
Share this question
or