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

Tracking when a pane's visibility changes

5 Answers 133 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Doug
Top achievements
Rank 1
Doug asked on 26 Sep 2011, 06:47 PM
I am using a RadDocking control in a page that hosts 12 panes and counting with by default 4 of them visible.  

I am tracking within my application when a pane's content is visible in order to determine when I need to load or refresh data in a pane. 

Currently I am using the LayoutUpdated of the docking control, but this is far from ideal because it is fired way too often and slows down the UI.  I have tried some other events without success, and read this post but didn't understand how to implement that, plus it is possibly more than I need to attach to since I don't care when a pane is moved around, only when it's visibility changes.  

Is there a better way to track this using either the docking/toolwindow events and if so, could you explain which events I need to subscribe to in order to track this?  

Thanks, 

Doug 

5 Answers, 1 is accepted

Sort by
0
George
Telerik team
answered on 29 Sep 2011, 07:31 AM
Hi Doug,

 
In order to detect when a pane is hidden or not, I would suggest using the Show and  Close events of RadDocking control. 

If you want to determine which pane is selected (for each group), you could use the RadPane.IsSelected property.

I am not sure what is exactly your scenario, but if you could attach an image or describe it in more details, this could shed some light on the problem.

Best wishes,
George
the Telerik team

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

0
Doug
Top achievements
Rank 1
answered on 29 Sep 2011, 07:12 PM
Hi George, 

thanks for responding.  

I am currently only able to track whether a pane's visibility changes using the layoutupdated event.  This event fires way too frequently to continually check each pane's visibility (!pane.IsHidden && pane.IsSelected) and notify my program when it needs to load data into a pane.  Many of the panes respond to different user interaction, and since I have so many of them, I need to know when a pane is visible or not and only load the data if they are visible.  

I tested the "Show" and "Close" events on the rad docking, that appears to only get fired when you close or show a pane (as you would expect, I suppose).  

What I really need is to track is when a pane's hidden or selected properties change.  I do see that the pane group has a "SelectionChanged" event, but I would be curious how to handle groups that are created dynamically by docking a pane elsewhere (as opposed to declared in the XAML).  


I've attached a screen shot of my UI for reference.  

Thanks, 

Doug 

0
George
Telerik team
answered on 04 Oct 2011, 04:52 PM
Hello Doug,

I would suggest using RadDocking.ActivePaneChanged event in order to detect when the selection is changed (in the RadDocking control). As long as I understand, you also want to track the when a pane is hidden or not - in this case, the Show and Close events will suit your need because when a pane is closed, it is actually hidden. But if you want to determine when a pane is pinned/unpinned, you could handle the PaneStateChanged event and check the current pane state.

Please, let me know if this helps.

Kind regards,
George
the Telerik team

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

0
Doug
Top achievements
Rank 1
answered on 12 Oct 2011, 03:25 PM
Hi George, 

Yes this is helpful.  I've replaced "LayoutUpdated" with the combination of "Show", "Close", "ActivePaneChanged" and "PaneStateChanged."

The one thing that I am not able to track is when an unpinned pane is shown and hidden.  Currently I am counting these panes as not visible, meaning that their content doesn't refresh itself when the content is revealed.  I would like to be able to track when the unpinned pane's content is shown and hidden so I can refresh their content only when needed.  

Thanks

Doug

0
George
Telerik team
answered on 17 Oct 2011, 08:42 AM
Hi Doug,

 
Please, refer to the following forum thread where you can find additional information about this scenario - http://www.telerik.com/community/forums/wpf/docking/slidein-slideout-or-hide-show-event.aspx

I understand this thread is for the WPF version of the docking control, but it works for the Silverlight version as well.

All the best,
George
the Telerik team

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

Tags
Docking
Asked by
Doug
Top achievements
Rank 1
Answers by
George
Telerik team
Doug
Top achievements
Rank 1
Share this question
or