需要幫助使用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