Need to know when a RadPane is visible.

2 posts, 1 answers
  1. Peter
    Peter avatar
    19 posts
    Member since:
    Sep 2011

    Posted 21 Oct 2011 Link to this post

    All terminology aside, I need to know when a pane is visible to a user.  And let me define visible as:

    1. Floating panes are always visible
    2. For panes in a tab group, the "selected" tab is visible, the rest are visible=false.
    3. Pinned panes which are collapsed are visible = false.  If the user clicks on them and they expand, then visible = true for that time period.
    4. Panes not in a tab group, are visible=true.

    I need this, as our panes have calculation engines in them which consume resources.  And if a pane isn't visible, then those resources shouldn't be wasted.  

    Through great panes, I've written a demo which attaches to EVERY event on RadDocking.  Trying to understand when things are triggered, as the documentation is insufficient in my opinion.  

    The attached demo project has a Pane which does calculation when calculate is set to true.  So in essence, it needs to be "fixed" for the following cases (which I consider bugs, as there's no event capable of telling me of the appropriate state changes):

    1. When a pane is added to a group, PaneStateChanged is called, but it's called BEFORE the state change, and not AFTER as the "ed" on Changed would imply.  So the pane isn't in it's new RadPaneGroup yet, and I don't know which panes to set calculate to false for.
    2. Pinned tabs.  This doesn't work at all.  Make a pane, dock it in the main window.  unpin it so it slurps up to the top..  Now, when hovering over "pane 1", the pane is shown. .but no events are triggered on RadDocking.  How am I to know to turn on calculation for the duration of the showing? Is there an event somewhere else to tell me this?

    It works in these cases, though the code to do it is ghetto.
    1. Changing tabs in a group.  I had to bind to ActivePaneChanged, and iterate through the Parent's of New/Old Pane's tabs, and update them all for the state change.  This is wasteful as RadDocking knows what I want to know internally.

    And great..  I can only attach pictures here.. wtf.  I'll add it to the support ticket then, and none of the lovely users of the community will be able to see it..  DUMB restriction!
  2. Answer
    Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 24 Oct 2011 Link to this post

    Hi Peter,

    To achieve what you need you could use the IsSelected property of the RadPane control (which is inherited from the RadTabItem) and which value is true when the pane is currently the visible pane in its group. It is the same for the unpinned panes, which are placed in the AutoHide area. Alternatively you could use the SelectedItem property of the RadPaneGroup or AutoHideArea (which is inherited from the RadTabControl) which holds a reference to the currently visible pane in the corresponding group.

    Hope this helps.
     
    As to the attachments - only images are allowed in the forums due to security reasons.

    Kind regards,
    Miroslav Nedyalkov
    the Telerik team

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

  3. UI for WPF is Visual Studio 2017 Ready
Back to Top