|
private void UpdateFlowDirectionofHeader(FlowDirection direction)
{
foreach (FrameworkElement child in DockingManager.Children)
{
if (DockingManager.GetDockHeaderPresenter(child) != null)
{
DockHeaderPresenter presenter = DockingManager.GetDockHeaderPresenter(child);
if (presenter != null)
{
DockPanel panel = VisualUtils.FindDescendant(presenter as Visual, typeof(DockPanel)) as DockPanel;
if (panel != null)
{
panel.FlowDirection = direction;
}
}
}
else
{
if(DockingManager.GetState(child) == DockState.Document)
{
MDIWindow window = VisualUtils.FindAncestor(child as Visual, typeof(MDIWindow)) as MDIWindow;
if(window != null)
{
DocumentHeader header = window.Template.FindName("PART_DocumentHeader", window) as DocumentHeader;
if(header != null)
{
header.FlowDirection = direction;
}
}
}
}
}
} |