0
 <Grid Height="525" MouseLeftButtonUp="ShowTextTrainerNote" Margin="20,0,30,0">
     <Grid.RowDefinitions>
         <RowDefinition Height="Auto"/>
         <RowDefinition Height="*"/>
     </Grid.RowDefinitions>
     <ListView ScrollViewer.VerticalScrollBarVisibility="Auto" 
               ScrollViewer.HorizontalScrollBarVisibility="Disabled"
               Grid.Row="0"
               ItemsSource="{Binding PlayerTrainerNote}"
               Width="516" x:Name="trainerNoteListView"
               ItemContainerStyle="{DynamicResource TrainerNoteListView}">
     </ListView>
     <DockPanel Visibility="Collapsed" 
                x:Name="dock" Background="White"
                Grid.Row="1" LastChildFill="True">
        <TextBox  BorderBrush="{x:Null}" TextWrapping="Wrap"  
                  x:Name="AddNotesTextBox" 
                  ScrollViewer.VerticalScrollBarVisibility="Auto"
                  Width="516" KeyUp="SaveTrainerNote"/>
     </DockPanel>
 </Grid>

我希望列表视图的高度是自动的,但是一旦我填充了一些数据,列表视图的高度就会设置为 525。我想成为自动的。我怎样才能做到这一点

4

0 回答 0