Why occur IsVisibleChanged and Unloaded when Dragging a RadPane?

3 posts, 0 answers
  1. Peter
    Peter avatar
    37 posts
    Member since:
    Dec 2011

    Posted 02 Mar 2012 Link to this post

    I'm wondering about the reason why RadPane and RadDocumentPane fire the IsVisibleChanged and Unloaded events when I'm just dragging the Pane to an other place on the screen (in my case out of my MainWindow)?

    IsVisibleChanged might be plausible, because the Pane becomes invisible for the split of a second, but Unloaded is not plausible, because the the Pane still exists.

    So to which event do I have to listen if I want to react on the user clicking on the small cross on the pane to close it, if  IsVisibleChanged and Unloaded happen also when the user is only dragging the Pane?

  2. Peter
    Peter avatar
    37 posts
    Member since:
    Dec 2011

    Posted 02 Mar 2012 Link to this post

    PS: I know that I could use the RadDocking.Close Event to check for closing Panes. But I think it's not logical, that the Panes' Unloaded Event fires if I'm just dragging the Pane...
  3. UI for WPF is Visual Studio 2017 Ready
  4. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 06 Mar 2012 Link to this post

    Hello Peter,

    When you drag a pane, it is moved in another place in the visual tree. Because of this the element is first removed from its old position, which causes the Unloaded event to be fired. After that it is placed in the new one (a ToolWindow) which causes the loaded method to be fired. This is what happens when visual elements are moved in the visual tree.

    What you could do is to track the Closed and Opened events instead as you correctly noticed.

    Hope this information is helpful.

    Kind regards,
    Miroslav Nedyalkov
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Back to Top