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

Get Pane state

1 Answer 73 Views
Docking
This is a migrated thread and some comments may be shown as answers.
hayula
Top achievements
Rank 1
hayula asked on 04 May 2009, 07:05 AM
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.

1 Answer, 1 is accepted

Sort by
0
Miroslav Nedyalkov
Telerik team
answered on 05 May 2009, 02:15 PM
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.
Tags
Docking
Asked by
hayula
Top achievements
Rank 1
Answers by
Miroslav Nedyalkov
Telerik team
Share this question
or