Wpf 网格中textblock中的wraptext

Wpf 网格中textblock中的wraptext,wpf,textblock,word-wrap,Wpf,Textblock,Word Wrap,我有一个网格,如下所示 最后一行的文本通常很长,我想把文本包装起来。但是文本根本没有换行。尝试去掉第5行,而第5行实际上没有效果。实际上,最初的行间距不在那里,但我添加了行间距以测试这是否有帮助。@DeanChalk什么对您有效?取出第5行和第5行?此网格是usercontrol的一部分。请尝试删除第5行,该行实际上没有效果。实际上,最初的行间距不在那里,但我添加了行间距以测试这是否有帮助。@DeanChalk什么对您有效?取出第5行和第5行?此网格是usercontrol的一部分。

我有一个网格,如下所示



最后一行的文本通常很长,我想把文本包装起来。但是文本根本没有换行。

尝试去掉第5行,而第5行实际上没有效果。实际上,最初的行间距不在那里,但我添加了行间距以测试这是否有帮助。@DeanChalk什么对您有效?取出第5行和第5行?此网格是usercontrol的一部分。请尝试删除第5行,该行实际上没有效果。实际上,最初的行间距不在那里,但我添加了行间距以测试这是否有帮助。@DeanChalk什么对您有效?取出第5行和第5行?此网格是usercontrol的一部分。
      <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="115"/>
            <ColumnDefinition Width="140"/>
            <ColumnDefinition Width="115"/>
            <ColumnDefinition Width="140"/>
        </Grid.ColumnDefinitions>

        <StackPanel Grid.Column="0" Grid.Row="0" Margin="5" Grid.RowSpan="5">
            <Border Margin="-1,-1,-1,-1" BorderBrush="#FFFFFFFF" BorderThickness="1,1,1,1" CornerRadius="2,2,2,2">
                <Border BorderThickness="1,1,1,1" CornerRadius="1,1,1,1" Background="#FFFFFFFF">
                    <Border.BorderBrush>
                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="#FF2F2F2F" Offset="1" />
                            <GradientStop Color="#FF515151" Offset="0.008" />
                        </LinearGradientBrush>
                    </Border.BorderBrush>
                    <Image Margin="5" Stretch="Fill" HorizontalAlignment="Left"
                           VerticalAlignment="Top"  Width="150" Height="150"
                           Tag="{Binding ID}" >
                    </Image>
                </Border>
            </Border>
        </StackPanel>

        <TextBlock Text="Lorem: " Grid.Row="1" Grid.Column="1"  FontWeight="Bold" />
        <TextBlock x:Name="txtId" Text="{Binding lorem}" Grid.Row="1" Grid.Column="2"/>
        <TextBlock Text="Status: " Grid.Row="1" Grid.Column="3" FontWeight="Bold"/>
        <TextBlock Text="{Binding Status}" Grid.Row="1" Grid.Column="4"/>

        <TextBlock Text="DTime: " Grid.Row="2" Grid.Column="1" FontWeight="Bold"/>
        <TextBlock x:Name="txtDetectTime" Text="{Binding DTime}" Grid.Row="2" Grid.Column="2"/>
        <TextBlock Text="CTime: " Grid.Row="2" Grid.Column="3" FontWeight="Bold"/>
        <TextBlock Text="{Binding CTime}" Grid.Row="2" Grid.Column="4" />
        <TextBlock Text="ClTime: " Grid.Row="3" Grid.Column="1"  FontWeight="Bold"/>
        <TextBlock Text="{Binding ClTime}" Grid.Row="3" Grid.Column="2"/>
        <TextBlock Text="Coordinate: " Grid.Row="4" Grid.Column="1" FontWeight="Bold"/>
        <TextBlock Text="{Binding Coordinate}"  Height="Auto" Grid.Row="4" Grid.Column="2" TextWrapping="WrapWithOverflow" Grid.RowSpan="2" />
        <TextBlock Text="Remark: " Grid.Row="4" Grid.Column="3" FontWeight="Bold"/>
        <TextBlock Text="{Binding Remark}" Grid.Row="4" Grid.Column="4"  Height="Auto" TextWrapping="WrapWithOverflow" Grid.RowSpan="2"/>


    </Grid>