レイアウトのメイン パネルとして Dockpanel を使用しています。上部のツールバーは上部に設定され、サイド パネルは左側に設定されます。ドキュメントビューアは、LastChildFill によって塗りつぶされるように設定されています。
問題は、ウィンドウのサイズが変更されても、スクロールビューアの高さがスケーリングされないことです。ドキュメントビューアのみが行います。子コンテンツが増加するにつれて、スケーリングするように見えます。Google Chrome の印刷レイアウトを模倣しようとしています。子がウィンドウをオーバーフローしない場合、スクロールバーはありませんが、ウィンドウよりも小さい場合は、スクロールバーがウィンドウを埋めます。
コードは次のとおりです。
<ToolBar Width="Auto" Height="35" DockPanel.Dock="Top" VerticalAlignment="Top" HorizontalAlignment="Stretch" Panel.ZIndex="10" Background="White">
<StackPanel Margin="5,0,0,0" Orientation="Horizontal">
<Button Content="New" Style="{StaticResource MenuItem}"/>
<Button Content="Save" Style="{StaticResource MenuItem}"/>
<Button Content="Print" Style="{StaticResource MenuItem}"/>
<Button Content="Delete" Style="{StaticResource MenuItem}"/>
<Button Content="Export" Style="{StaticResource MenuItem}"/>
<Border Style="{StaticResource SeparatorStyle}"/>
<Button Content="Burn DVD" Style="{StaticResource MenuItem}"/>
<Button Content="Open Folder" Style="{StaticResource MenuItem}"/>
<Border Style="{StaticResource SeparatorStyle}"/>
<Button Content="Next Patient" Style="{StaticResource MenuItem}"/>
</StackPanel>
</ToolBar>
<ScrollViewer Background="White" x:Name="SidePanel" HorizontalAlignment="Left" Margin="0" VerticalAlignment="Top" Width="400" DockPanel.Dock="Left" Panel.ZIndex="2" Padding="10">
<StackPanel>
<StackPanel.Resources>
<Style TargetType="{x:Type TextBox}">
<Setter Property="Margin" Value="0,10,0,0"/>
</Style>
</StackPanel.Resources>
<Label Content="Patient Report" Style="{StaticResource SidePanel_H1}" />
<Rectangle Style="{StaticResource SidePanel_HR}" />
<TextBox Text="DATA"/>
<TextBox Text="DATA"/>
<TextBox Text="DATA"/>
<TextBox Text="DATA"/>
<TextBox Text="DATA"/>
<TextBox Text="DATA"/>
<TextBox Text="DATA"/>
<TextBox Text="DATA"/>
<TextBox Text="DATA"/>
<TextBox Text="DATA"/>
<TextBox Text="DATA"/>
<TextBox Text="DATA"/>
<TextBox Text="DATA"/>
<TextBox Text="DATA"/>
<TextBox Text="DATA"/>
</StackPanel>
</ScrollViewer>
<Rectangle Height="Auto" Width="2" DockPanel.Dock="Left" Fill="#FFA0A0A0"/>
<DocumentViewer x:Name="dv1" AllowDrop="False" Cursor="Hand" Loaded="dv1_Loaded" MinWidth="600">
<FixedDocument Focusable="False" x:Name="FD">
</FixedDocument>
</DocumentViewer>
</DockPanel>