
Demo XAML:
<docking:DockSite>
<docking:SplitContainer Orientation="Vertical">
<docking:SplitContainer>
<docking:ToolWindowContainer>
<docking:ToolWindow
Title="Bla"
ContainerDockedSize="270,200"
ContainerMinSize="150,150" />
</docking:ToolWindowContainer>
<docking:Workspace x:Name="workspace">
<docking:TabbedMdiHost x:Name="tabbedMdiHost" />
</docking:Workspace>
</docking:SplitContainer>
</docking:SplitContainer>
</docking:DockSite>
Demo C#:
private void Window_PreviewMouseDown(object sender, MouseButtonEventArgs e)
{
this.ResizeMode = ResizeMode.CanMinimize;
workspace.Visibility = Visibility.Collapsed;
this.SizeToContent = SizeToContent.Width;
}
I would expect the form gets shrunk to the width of the ToolWindow but instead it gets expanded to the whole desktop. Whats the best way to get SizeToContent to work, preferrably without breaking MVVM too much (at the top its just demo code, in our application we use MVVM and things are bound back to a point where accessing UI controls is hardly doable)