我想要的網格是背景色爲azure的網格:爲什麼子網格不擴展以填充父網格寬度?
不知何故,它不能達到LayoutRoot的全寬,並且以編程方式設置它的寬度將導致佈局循環異常。我也試着結合寬度父佈局......但似乎並沒有工作,要麼:(
<Border Style="{StaticResource ZoomBorderStyle}">
<Grid x:Name="LayoutRoot">
<Grid.RowDefinitions>
<RowDefinition Height="37"/>
<RowDefinition Height="76"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<localView:ViewerMenu Width="Auto"
ZoomIn="ViewerMenu_ZoomIn"
ZoomOut="ViewerMenu_ZoomOut"
LayoutOne="ViewerMenu_One"
LayoutFour="ViewerMenu_Four"
ResoFull="ViewerMenu_Full"
Background="White" />
<localView:ImageDetails Grid.Row="1"
ImageMetadata="{Binding CurrentImageContext}"
VerticalAlignment="Top"
Height="Auto"
HorizontalAlignment="Stretch"
Width="Auto"/>
<Grid Grid.Row="1" Grid.RowSpan="2" x:Name="ViewerWrapper" Background="Azure"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch">
<Grid x:Name="QuadPanel" Visibility="Collapsed">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<zoomControls:QuadPanelImage x:Name="QuadImageTopLeft" Content="{Binding ImageTopLeft}" Margin="15" Grid.Row="0"
Grid.Column="0"
PanelPosition="TopLeft"
MouseLeftDoubleClick="InciteContentControl_MouseLeftDoubleClick"
HorizontalContentAlignment="Center"/>
<zoomControls:QuadPanelImage x:Name="QuadImageTopRight" Content="{Binding ImageTopRight}" Margin="15" Grid.Row="0"
Grid.Column="1"
PanelPosition="TopRight"
MouseLeftDoubleClick="InciteContentControl_MouseLeftDoubleClick"
HorizontalContentAlignment="Center"/>
<zoomControls:QuadPanelImage x:Name="QuadImageBottomLeft" Content="{Binding ImageBottomLeft}" Margin="15" Grid.Row="1"
Grid.Column="0"
PanelPosition="BottomLeft"
MouseLeftDoubleClick="InciteContentControl_MouseLeftDoubleClick"
HorizontalContentAlignment="Center"/>
<zoomControls:QuadPanelImage x:Name="QuadImageBottomRight" Content="{Binding ImageBottomRight}" Margin="15" Grid.Row="1"
Grid.Column="1"
PanelPosition="BottomRight"
MouseLeftDoubleClick="InciteContentControl_MouseLeftDoubleClick"
HorizontalContentAlignment="Center"/>
</Grid>
謝謝!我會給它一個去看看它是否是邊界干擾。 – bcm 2010-09-21 08:59:20
我嘗試刪除邊框或向邊框添加拉伸,兩者都不起作用。 LayoutRoot網格根據內容擴展或縮小,即使對於水平和垂直也是如此。 – bcm 2010-09-21 22:26:39