Posted 13 years ago
by Mary Fontana
-
Rudolph Technologies
I have a docksite that uses splitcontainer :
I also set ratio of containers in the onloaded event:
I also have code that programmatically adds a other tool windows that are not on intial display.
After a user floats and re-docks with tool windows possibly in a differnt container.
I would like to have a "refresh" button to set the docksite view as it looked in its initial view when first started.
Is there a way to do this?
[Modified at 08/11/2011 05:46 PM]
<docking:DockSite x:Name="dockSite"
CanDocumentWindowsRaft="True"
ToolWindowsHaveTitleBars="True" ToolWindowsTabPlacement="Bottom"
ToolWindowsSingleTabLayoutBehavior="Show"
ToolWindowsTabOverflowBehavior="ShrinkWithMenu"
CanToolWindowsClose="True"
CanToolWindowsRestoreToAutoHideState="True"
CanToolWindowsAutoHide="True" AutoHidePopupCloseAnimation="None" AutoHidePopupOpenAnimation="None" CanToolWindowsBecomeDocuments="False">
<docking:SplitContainer Orientation="Horizontal">
<docking:SplitContainer Orientation="Vertical">
<docking:ToolWindowContainer>
<docking:ToolWindow x:Name="topLeftWindow1" Title="Window1"
CanClose="False" >
</docking:ToolWindow>
<docking:ToolWindow x:Name="topLeftWindow2" Title="Window2"
CanClose="False" >
</docking:ToolWindow>
<docking:ToolWindow x:Name="topLeftWindow3" Title="Window3"
CanClose="False" >
</docking:ToolWindow>
</docking:ToolWindowContainer>
<docking:ToolWindowContainer>
<docking:ToolWindow x:Name="mainPropWindow" Title="Main Properties"
CanClose="False" >
<local:PropGridView/>
</docking:ToolWindow>
</docking:ToolWindowContainer>
</docking:SplitContainer>
<docking:SplitContainer Orientation="Vertical">
<docking:ToolWindowContainer docking:DockSite.ControlSize="250, 300">
<docking:ToolWindow x:Name="topRightWindow" Title="Tool1"
CanRaft="False" CanClose="False" CanAutoHide="True" >
</docking:ToolWindow>
</docking:ToolWindowContainer>
<docking:ToolWindowContainer docking:DockSite.ControlSize="250, 300">
<docking:ToolWindow x:Name="bottomRightWindow" Title="Tool2"
CanRaft="False" CanClose="False" >
</docking:ToolWindow>
<docking:ToolWindow x:Name="bottomRightWindow2" Title="Tool3"
CanRaft="False" CanClose="False" >
</docking:ToolWindow>
</docking:ToolWindowContainer>
</docking:SplitContainer>
</docking:SplitContainer>
</docking:DockSite>
private void OnLoaded(object sender, RoutedEventArgs e)
{
this.ResetSplitterRatio();
}
private void ResetSplitterRatio()
{
IList<DependencyObject> descendents = VisualTreeHelperExtended.GetAllDescendants(this.revisionDockSite, typeof(SplitContainer));
if (null != descendents)
{
foreach (SplitContainer splitContainer in descendents)
{
if (splitContainer.Orientation == Orientation.Horizontal)
splitContainer.ResizeSlots(2.6, 1);
else
splitContainer.ResizeSlots(2, 1);
}
}
}
After a user floats and re-docks with tool windows possibly in a differnt container.
I would like to have a "refresh" button to set the docksite view as it looked in its initial view when first started.
Is there a way to do this?
[Modified at 08/11/2011 05:46 PM]