Hi Forum!
I've two (nested SplitContainer) and want to programmtically resize them:When I run the following code (it's a tester so it is in my main window's contructor):
The horizontal SplitContainer resizes as expected, but the vertical one resizes to a ratio of 1:1 and I'dont know why.
Thank you!
Renee.
I've two (nested SplitContainer) and want to programmtically resize them:
<docking:DockSite x:Name="dockSite" >
<docking:SplitContainer Orientation="Horizontal">
<docking:ToolWindowContainer x:Name="CommandContainer">
<docking:ToolWindow x:Name="CommandToolWindow" Title="">
</docking:ToolWindow>
</docking:ToolWindowContainer>
<docking:SplitContainer Orientation="Horizontal">
<docking:ToolWindowContainer x:Name="MainContainer">
<docking:ToolWindow x:Name="DebugOutContainer" Title="" >
<docking:DocumentWindow x:Name="DebugOutput" Title="Status Window"
Description="Status and racindow"
FileName="debug.rtf" IsReadOnly="True">
<TextBox Name="DebugOutputText" BorderThickness="0" TextWrapping="NoWrap"
Text=""
IsReadOnly="{Binding ElementName=debugOutput,
Path=IsReadOnly}"/>
</docking:DocumentWindow>
</docking:ToolWindow>
</docking:ToolWindowContainer>
</docking:SplitContainer>
</docking:SplitContainer>
</docking:DockSite>
ResultControl res = new ResultControl(_dynamicSet, _mainThreadDispatcher,_debugFunction);
ToolWindow window = new ToolWindow(dockSite, "", "", new BitmapImage(
new Uri("/Resources/lock.png",UriKind.Relative)),
res );
window.Dock(MainContainer, Direction.Top);
SplitContainer= MainVertSplit(SplitContainer)VisualTreeHelperExtended.GetAncestor(MainContainer, typeof(SplitContainer));
if (null != MainVertSplit)
{
MainVertSplit.ResizeSlots(2, 1);
}
SplitContainer MainHorzSplit = (SplitContainer)VisualTreeHelperExtended.GetAncestor(CommandContainer, typeof(SplitContainer));
if (null != MainHorzSplit)
{
MainHorzSplit.ResizeSlots(1, 2);
}
Thank you!
Renee.