我有两个关于我有窗口的大小问题。基本的布局是这样的与内容有关的窗口大小
<Window MaxHeight="{DynamicResource {x:Static SystemParameters.VirtualScreenHeight}}"
MaxWidth="{DynamicResource {x:Static SystemParameters.VirtualScreenWidth}}"
>
<StackPanel>
<DockPanel LastChildFill="False">
<StackPanel DockPanel.Dock="Left"
Orientation="Horizontal">
<!--Some buttons-->
</StackPanel>
<StackPanel DockPanel.Dock="Right"
Orientation="Horizontal">
<!--Some buttons-->
</StackPanel>
</DockPanel>
<ScrollViewer>
<WrapPanel x:Name="Container">
</WrapPanel>
</ScrollViewer>
</StackPanel>
</Window>
1)我如何使窗口水平比DockPanel的宽度更小?
2)如何让ScrollViewer限制在窗口的限制范围内?它的内容大小已经超出了窗口的范围。
它像是用来工作,当我有
<Window><ScrollViewer/></Window>
,但我真的不希望滚动里面的DockPanel中。在目前的形式下,它甚至迫使Window打破了MaxHeight。