我得到的图层如下:
<Window>
<Grid>
<Scrollviewer>
<Canvas>
....
<Canvas/>
<Scrollviewer/>
<Grid/>
<Window/>
现在,如果我希望我的网格扩展并遵循窗口的高度和宽度,我使用以下代码:
<Window Title="MainWindow" Name="Window" MinHeight="500" MinWidth="800">
<Grid Height="{Binding ElementName=Window, Path=Height}" Width="{Binding ElementName=Window, Path=Width}" x:Name="theGrid">
<Grid.RowDefinitions>
<RowDefinition Height="436*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" Margin="0,50,15,66">
<Canvas MinWidth="{Binding ElementName=theGrid, Path=Width}" MinHeight="{Binding ElementName=theGrid, Path=Height}" Name="canvas1">
<Canvas.LayoutTransform>
<ScaleTransform ScaleX="{Binding Path=Value, ElementName=slider1}"
ScaleY="{Binding Path=Value, ElementName=slider1}"/>
</Canvas.LayoutTransform>
</Canvas>
</ScrollViewer>
当我通过拉窗口的边/角来调整窗口大小时,这很好用..!但是!当我点击右上角的“全屏”按钮时,它只显示最后一张图片网格的网格大小。像这样:
就像它在“全屏”后不会重新绘制网格一样......帮帮我?