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

Command binding to window close event.

4 Answers 148 Views
Window
This is a migrated thread and some comments may be shown as answers.
Clint Singer
Top achievements
Rank 1
Clint Singer asked on 17 Feb 2010, 06:11 PM
Hi,

I have a user control that is in a RadWindow.  The usercontrol has two buttons, OK and Cancel, which are bound via command binding to the view model.  The usercontrol knows it is hosted in the RadWindow.

What is the recommended way to call the cancel command when the user clicks the red x close button.   Currently the commands are bound in XAML.

Cheers,
Clint

4 Answers, 1 is accepted

Sort by
0
Accepted
Miroslav Nedyalkov
Telerik team
answered on 18 Feb 2010, 10:04 AM
Hi Clint,

 You could use the Window Closed event of the RadWindow control for this. Unfortunately there is no straight-forward way to bind your command this event.

You could also "listen" for the commands that the RadWindow control throws - the WindowCommands.Close command is thrown when the close button is hit.

Hope this helps.

Kind regards,
Miroslav Nedyalkov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Clint Singer
Top achievements
Rank 1
answered on 18 Feb 2010, 04:53 PM
Alright,

At least I know now.  I will then just listen for the Close event and then fire off the Command in code.

Cheers,
Clint
0
DragonBall
Top achievements
Rank 1
answered on 14 May 2010, 05:46 AM
how do i listen to the events that radwindow does. can you give code sippet thanx
0
Miroslav Nedyalkov
Telerik team
answered on 14 May 2010, 06:55 AM
Hi DragonBall,

 You could refer to the following example: http://demos.telerik.com/silverlight/#Window/Events.
Or to the online help of the RadWindow control: http://www.telerik.com/help/silverlight/radwindow-overview.html.

Greetings,
Miroslav Nedyalkov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Window
Asked by
Clint Singer
Top achievements
Rank 1
Answers by
Miroslav Nedyalkov
Telerik team
Clint Singer
Top achievements
Rank 1
DragonBall
Top achievements
Rank 1
Share this question
or