2

次のようなグリッドがあります

      <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>

最後の行のテキストは通常​​非常に長いので、テキストを折り返す必要があります。しかし、テキストはまったく折り返されていません。

4

0 に答える 0