需要帮助使用xaml布局。在WrapPanel内部自动调整大小?
我有一个内部有两个元素的Wrapanel。 MainGrid的左边一个需要固定在900像素。第二个是AuxillaryDataScrollViewer,如果WrapPanel包装它,我希望最小为650,最大为100%。这可能吗?
这是我走到这一步:
<Window x:Class="scratch.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="768" Width="1024">
<Grid>
<ScrollViewer>
<WrapPanel>
<Grid Width="900" Height="800" Background="Bisque"></Grid>
<ScrollViewer HorizontalScrollBarVisibility="Visible" VerticalScrollBarVisibility="Hidden" Width="650">
<Grid Width="1500" Height="700" Background="Tomato"></Grid>
</ScrollViewer>
</WrapPanel>
</ScrollViewer>
</Grid>
</Window>
谢谢!
编辑加入了更多的细节:
客户希望做数据录入,看到在面板右侧的计算结果实时,但一些在他的实验室的电脑只能够1280pixels对那些宽度,他希望将结果包装到数据输入表单下方。
你想要两个元素并排吗? – voddy
如果显示器有分辨率,如果不是我想要它包装。 – safetyOtter
我测试了你的代码,它可以像你期望的那样工作。 – voddy