How can I close a RadWindow that contains a userControl from itself (usercontrol code)... and using a ViewModel?
Thanks
2 Answers, 1 is accepted
0
Konstantina
Telerik team
answered on 03 Aug 2011, 07:41 AM
Hello Carlos,
Initially, you could use the Close() method to close the RadWindow. Could you please give us some more information of what exactly you are trying to achieve? Providing some more details about your case will be very helpful for suggesting you the best approach.
Looking forward to your reply.
Greetings,
Konstantina
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>
If you are just looking to close the window from a button I would just use a simple behaviour on the button. Below is the behaviour I use for that purpose. It has a couple of other properties that you do not need if all you want to do is just close the window. However, if you want to initiate the closing of the window from your viewmodel, it is a little trickier. I use MVVM Light, so I would use the Messenger functionality in that framework to send a message from the viewmodel to the view. The view would then close the parent window using code similar to the method "CloseParentWindow" in the behaviour below.
/// <summary>
/// When the button is clicked, its parent RadWindow will be closed