AddHandler on Window LocationChanged event

3 posts, 0 answers
  1. Ludovic Gerbault
    Ludovic Gerbault avatar
    226 posts
    Member since:
    Apr 2009

    Posted 22 Sep 2011 Link to this post

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

    Posted 22 Sep 2011 Link to this post

    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 >>

  3. DevCraft banner
  4. Ludovic Gerbault
    Ludovic Gerbault avatar
    226 posts
    Member since:
    Apr 2009

    Posted 22 Sep 2011 Link to this post

    I was afraid you might say that.

    Back to work then :lol:

    Thanks.
Back to Top