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

Handle click outside window in ShowDialog

1 Answer 717 Views
Window
This is a migrated thread and some comments may be shown as answers.
Jared Robertson
Top achievements
Rank 1
Jared Robertson asked on 11 Jun 2012, 03:58 PM
The silverlight forums have this exact same question and a great solution for it: http://www.telerik.com/community/forums/silverlight/window/handle-click-outside-window-in-showdialog.aspx#0
However, the solution doesn't work in WPF.

Basically I need to be able to close the RadWindow if the user clicks outside of it. For the silverlight version, the canvas that covers the application is exposed and I can attach a MouseLeftButtonDown event handler to it. I haven't been able to do this for the WPF version because none of the accessible parents are the background where a user would click. The parents of the RadWindow are ContentPresenter, AdornerPresenter, Border, and then InternalWindow (I can't access InternalWindow).

Thanks in advance!

1 Answer, 1 is accepted

Sort by
0
Accepted
Ivo
Telerik team
answered on 12 Jun 2012, 12:08 PM
Hi Jared,

I don't think that this can be achieved in a similar way into WPF. The best I can think of is to handle your MainWindow's Activated event and close the opened dialogs there. Into this case you will have to use Show instead of ShowDialog.

All the best,
Ivo
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
Window
Asked by
Jared Robertson
Top achievements
Rank 1
Answers by
Ivo
Telerik team
Share this question
or