Modifying an ItemsPanel's Grid RowDefinitionCollection
问题 This is a followup for ItemsControl has no children during MainWindow's constructor Based on the answer to SO question "WPF: arranging collection items in a grid", I have the following: <ItemsControl Name="itemsControl1" ItemsSource="{Binding MyItems}"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <Grid Name="theGrid" ShowGridLines="True" /> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> <ItemsControl.ItemContainerStyle> <Style TargetType="{x:Type FrameworkElement}"> <Setter Property=