Grid.IsSharedSizeScope를 사용하여 Grid의 첫 번째 열에있는 일부 contols 옆에있는 ItemsControl에 의해 표시된 데이터 바인딩 된 컨트롤을 정렬하려고합니다.Grid.IsSharedSizeScope 및 ItemsControl.ItemTemplate WPF 레이아웃 문제
문제는 컨트롤이 수직으로 계속 커지지 않도록 할 수 없다는 것입니다.
어떻게 MaxHeight 속성을 설정하지 않고이 작업을 중단 할 수 있습니까? 나는 다양한 장소에서 VerticalAlignment와 VerticalContentAlignment의 다른 설정을 시도했지만 알아낼 수는 없다. 좋은 두 개의 열이있는 다른 그리드 내부에 옆에 그리드 및 ItemsControl에면을 넣고, 나쁜 중첩 격자에 Grid.IsSharedSizeScope를 사용하려고
<Grid Grid.IsSharedSizeScope="True" >
<Grid.RowDefinitions>
<RowDefinition SharedSizeGroup="RowOne" />
<RowDefinition SharedSizeGroup="RowTwo" />
<RowDefinition SharedSizeGroup="RowThree" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<SomeControl Grid.Row="0" Grid.Column="0" />
<SomeControl Grid.Row="1" Grid.Column="0" />
<ItemsControl Grid.Row="0" Grid.Column="1" Grid.RowSpan="3" ItemsSource="{Binding Path=SomeSource}" ItemsPanel="{StaticResource MyHorizontalStackPanel}" >
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.RowDefinitions>
<RowDefinition SharedSizeGroup="RowOne" />
<RowDefinition SharedSizeGroup="RowTwo" />
<RowDefinition SharedSizeGroup="RowThree" />
</Grid.RowDefinitions>
<SomeControl Grid.Row="0" />
<SomeControl Grid.Row="1" />
<SomeControl Grid.Row="2" />
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Grid>
... –
+1 ;-) 자신에 너무 가혹하지 않습니다. 이것 대단히 고마워. 당신의 접근 방식은 당신의 질문에있는 예제와 비슷한 것을 사용할 때 머리글에서 나는 끔찍한 깜박임을 없앴습니다. 이전에는 일종의 무한 레이아웃 루프에 빠져 있었지만,이 새로운 접근 방식으로 바로 정렬되었습니다. –