Command binding to window close event.

5 posts, 1 answers
  1. Clint Singer
    Clint Singer avatar
    133 posts
    Member since:
    Oct 2012

    Posted 17 Feb 2010 Link to this post

    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
  2. Answer
    Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 18 Feb 2010 Link to this post

    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.
  3. DevCraft banner
  4. Clint Singer
    Clint Singer avatar
    133 posts
    Member since:
    Oct 2012

    Posted 18 Feb 2010 Link to this post

    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
  5. DragonBall
    DragonBall avatar
    53 posts
    Member since:
    Jul 2008

    Posted 14 May 2010 Link to this post

    how do i listen to the events that radwindow does. can you give code sippet thanx
  6. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 14 May 2010 Link to this post

    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.
Back to Top
DevCraft banner