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

Why occur IsVisibleChanged and Unloaded when Dragging a RadPane?

2 Answers 37 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 1
Peter asked on 02 Mar 2012, 04:04 PM

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 Answers, 1 is accepted

Sort by
0
Peter
Top achievements
Rank 1
answered on 02 Mar 2012, 05:10 PM
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...
0
Miroslav Nedyalkov
Telerik team
answered on 06 Mar 2012, 01:40 PM
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 >>
Tags
Docking
Asked by
Peter
Top achievements
Rank 1
Answers by
Peter
Top achievements
Rank 1
Miroslav Nedyalkov
Telerik team
Share this question
or