How to unsubscribe class handlers?

2 posts, 0 answers
  1. yogesh
    yogesh avatar
    1 posts
    Member since:
    Apr 2011

    Posted 28 Jan 2016 Link to this post

    I need to unsubscribe these events

     1. EventManager.RegisterClassHandler(typeof(RadTreeViewItem), Mouse.MouseDownEvent, new MouseButtonEventHandler(OnTreeViewItemMouseDown), false);
    2. RegisterClassHandler(typeof(RadTreeView), RadDragAndDropManager.DragInfoEvent, new EventHandler<DragDropEventArgs>(OnTreeViewDragInfo), false);
    3. RegisterClassHandler(typeof(RadTreeView), RadDragAndDropManager.DropQueryEvent, new EventHandler<DragDropQueryEventArgs>(OnTreeViewDropQuery), true);
  2. Martin Ivanov
    Martin Ivanov avatar
    2391 posts

    Posted 01 Feb 2016 Link to this post

    Hello Yogesh,

    EventManager doesn't provide a method for unsubscribing for the globally registered event handlers. If you want to remove a handler you can use the RemoveHandler() method of UIElement. 

    Also, keep in mind that RadDragAndDropManager is our old drag/drop API. We have a new manager called DragDropManager which has better implementation and it resolves some of the issue in the old drag/drop manager. With DragDropManager you can subscribe for the events using its Add[eventname]Handler() methods and the Remove[eventname]Handler() methods for removing handlers respectively.

    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 Feedback Portal and vote to affect the priority of the items
Back to Top