Posted 14 years ago
by Steve py
Version: 10.2.0531
Platform: .NET 3.5
Environment: Windows XP (32-bit)
I was reading up on how to specify a size for a SplitContainer and tried a ResizeSlots() call from code-behind. This doesn't appear to be working in cases where an application starts up with ToolWindowContainer a Workspace containing an empty TabbedMDIHost. I specified a call to ResizeSlots(1,3) Expecting the tool window container to take 1/4 of the space. It resizes, but takes 1/2. I've tried various different settings and it always takes half.
XAML
<docking:SplitContainer>
<docking:SplitContainer x:Name="uxSplit" Orientation="Horizontal" >
<docking:ToolWindowContainer>
<docking:ToolWindow x:Name="uiMenu" Title="Menu">
<domain:UIMenu MortgageSelected="UIMenu_MortgageSelected"></domain:UIMenu>
</docking:ToolWindow>
</docking:ToolWindowContainer>
<docking:Workspace>
<docking:TabbedMdiHost x:Name="tabbedMdiHost" TabPlacement="Bottom">
<docking:TabbedMdiContainer x:Name="uxContainer">
</docking:TabbedMdiContainer>
</docking:TabbedMdiHost>
</docking:Workspace>
</docking:SplitContainer>
</docking:SplitContainer>
Windows are added to the MDI container programatically based on navigation controls. (UIMenu)
I did find a work-around mentioned in other posts that worked for anyone having similar issues. I added docking:DockSite.ControlSize="300,100" to the ToolWindowContainer to force it to a width of 300. (The height of 100 is ignored since it's docked)
...
<docking:ToolWindowContainer docking:DockSite.ControlSize="300,100">
...
Still, I'd expect the call to ResizeSlots to work even if there is no active document or tool window in the secondary pane.
XAML
<docking:SplitContainer>
<docking:SplitContainer x:Name="uxSplit" Orientation="Horizontal" >
<docking:ToolWindowContainer>
<docking:ToolWindow x:Name="uiMenu" Title="Menu">
<domain:UIMenu MortgageSelected="UIMenu_MortgageSelected"></domain:UIMenu>
</docking:ToolWindow>
</docking:ToolWindowContainer>
<docking:Workspace>
<docking:TabbedMdiHost x:Name="tabbedMdiHost" TabPlacement="Bottom">
<docking:TabbedMdiContainer x:Name="uxContainer">
</docking:TabbedMdiContainer>
</docking:TabbedMdiHost>
</docking:Workspace>
</docking:SplitContainer>
</docking:SplitContainer>
Windows are added to the MDI container programatically based on navigation controls. (UIMenu)
I did find a work-around mentioned in other posts that worked for anyone having similar issues. I added docking:DockSite.ControlSize="300,100" to the ToolWindowContainer to force it to a width of 300. (The height of 100 is ignored since it's docked)
...
<docking:ToolWindowContainer docking:DockSite.ControlSize="300,100">
...
Still, I'd expect the call to ResizeSlots to work even if there is no active document or tool window in the secondary pane.