不知何故 textwrap 不起作用。
我是 WPF 的新手,所以如果有人知道为什么这不起作用,我将不胜感激。
这是我的代码:
<ItemsControl Grid.ColumnSpan="3" Grid.Row="1" Margin="0 0 0 0" ItemsSource="{Binding VRCItemsPaged}">
<ItemsControl.Template>
<ControlTemplate>
<StackPanel Orientation="Vertical">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="310"/>
<ColumnDefinition Width="110"/>
<ColumnDefinition Width="351"/>
</Grid.ColumnDefinitions>
<TextBlock Style="{StaticResource Label}" Grid.Column="0" Text="Description"/>
<TextBlock Style="{StaticResource Label}" Grid.Column="1" Text="Code"/>
<TextBlock Style="{StaticResource Label}" Grid.Column="2" Text="Value"/>
</Grid>
<StackPanel Orientation="Vertical" IsItemsHost="True"/>
</StackPanel>
</ControlTemplate>
</ItemsControl.Template>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid Height="Auto">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="280"/>
<ColumnDefinition Width="30"></ColumnDefinition>
<ColumnDefinition Width="80"/>
<ColumnDefinition Width="30"></ColumnDefinition>
<ColumnDefinition Width="351"/>
</Grid.ColumnDefinitions>
<TextBox FontWeight="Normal" TextWrapping="Wrap" IsEnabled="False" Grid.Column="0" Text="{Binding Path=Description}"/>
<TextBox FontWeight="Normal" Grid.Column="2" IsEnabled="False" Text="{Binding Path=Code}"/>
<TextBox FontWeight="Normal" Grid.Column="4" IsEnabled="False" Text="{Binding Path=Value}"/>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>