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

AddHandler on Window LocationChanged event

2 Answers 101 Views
Window
This is a migrated thread and some comments may be shown as answers.
Ludovic Gerbault
Top achievements
Rank 1
Ludovic Gerbault asked on 22 Sep 2011, 10:14 AM
Hi

I'm currently trying to add an application scope event on the location changed event of all radwindow.
It's a method I'm using to catch routedevent on child classes of my application and treat them on higher hierarchical levels.

My goal is to have an handler like mymaincontrol.AddHandler(RadWIndow.LocationChangedEvent, new routedhandler....

And a method allowing me to control the radwinow position and previent it to go to RadWinow.Top < 0 (off screen).

I can do it easily by subscribing each window to the event, but I have a lot of RadWindow.

The problem is : There is no RadWindow.LocationChangedEvent (like the RadButton.ClickEvent).

Can you provide with a workaround, do you have any plans to provide this event at this level in the future ?

Regards

Ludovic

2 Answers, 1 is accepted

Sort by
0
Miroslav Nedyalkov
Telerik team
answered on 22 Sep 2011, 01:07 PM
Hi Subileau,

 The problem is that the LocationChanged event is not a RoutedEvent so it doesn't have a RoutedEvent identifier (the static filed ending with Event). The only way to hook-up to the CLR event (named LocationChanged). A single place to do that is to create a class that inherits from the RadWindow class use your custom class instead of the RadWindow class in your application.

Hope this helps.

Kind regards,
Miroslav Nedyalkov
the Telerik team

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

0
Ludovic Gerbault
Top achievements
Rank 1
answered on 22 Sep 2011, 01:16 PM
I was afraid you might say that.

Back to work then :lol:

Thanks.
Tags
Window
Asked by
Ludovic Gerbault
Top achievements
Rank 1
Answers by
Miroslav Nedyalkov
Telerik team
Ludovic Gerbault
Top achievements
Rank 1
Share this question
or