Tracking when a pane's visibility changes

6 posts, 0 answers
  1. Doug
    Doug avatar
    19 posts
    Member since:
    Jun 2010

    Posted 26 Sep 2011 Link to this post

    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 
  2. George
    Admin
    George avatar
    1332 posts

    Posted 29 Sep 2011 Link to this post

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

  3. DevCraft banner
  4. Doug
    Doug avatar
    19 posts
    Member since:
    Jun 2010

    Posted 29 Sep 2011 Link to this post

    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 

  5. George
    Admin
    George avatar
    1332 posts

    Posted 04 Oct 2011 Link to this post

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

  6. Doug
    Doug avatar
    19 posts
    Member since:
    Jun 2010

    Posted 12 Oct 2011 Link to this post

    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

  7. George
    Admin
    George avatar
    1332 posts

    Posted 17 Oct 2011 Link to this post

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

Back to Top
DevCraft banner