Get Pane state

2 posts, 0 answers
  1. hayula
    hayula avatar
    8 posts
    Member since:
    Apr 2009

    Posted 04 May 2009 Link to this post

    Is there a way to get pane visibility state and pane width when user changed pane size?
    i'm try to used with size_change event but, it's occur  just in loading.
  2. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 05 May 2009 Link to this post

    Hi hayula,

    It looks like that the SizeChanged event is not fired correctly because the pane is only the tab header, not the whole content. The other part (the content of the pane) is not rendered in the pane. This is the behavior of the TabControl and we use it in the Docking control, too. What I can suggest is that you handle the SizeChanged event of the content of the pane or handle the same event of the group that contains the pane. The group actually renders the content, so when you resize, the group gets resized, too.
    This is the same for the size, too. The pane is just the tab header, so its size is different from its content's size.
    About the visibility state - if you meant if the pane's content visible at this moment or not, you could check whether the parent group of the pane has the same SelectedItem as the pane or not.
    If you meant if the header is visible at all you should check two things - the IsHidden property of the pane and whether the pane is in a closed window. If both are false - the pane is visible. The following boolean expression checks if the RadPane control with name pane is currently visible or not:
    !pane.IsHidden && (!pane.IsFloating || IsParentWindowVisible(pane)) 
    where we have:
    static bool IsParentWindowVisible(RadPane pane) 
        FrameworkElement parent = pane.Parent as FrameworkElement; 
        while (parent != null
        { 
            ToolWindow parentWindow = parent.Parent as ToolWindow; 
            if (parent != null
            { 
                return parentWindow.Visibility != Visibility.Collapsed; 
            } 
            parent = parent.Parent as FrameworkElement; 
        } 
        return false

    Hope this information helps.

    Regards,
    Miroslav Nedyalkov
    the Telerik team

    Instantly find answers to your questions on the newTelerik Support Portal.
    Check out the tipsfor optimizing your support resource searches.
Back to Top