1

リストボックスにデータバインディングがあり、texttrimmingプロパティがWordEllipsisに設定されていますが、機能していないようです。textblockは、texttrimmingプロパティが設定されていない場合と同じようにテキストを表示しています。これは私のxamlコードです。助けてください。

           <Grid>
                <Grid.Resources>
                    <application:ViewModel x:Key="ViewModel"/>
                </Grid.Resources>
                <TextBlock Height="75" TextWrapping="Wrap" Text="Click on Settings to search for quotes (by author or by query)." VerticalAlignment="Top" TextAlignment="Center" FontSize="26.667"/>
                <ListBox Margin="0,166,0,0" Name="lstQuote" DoubleTap="lstQuote_DoubleTap" Hold="lstQuote_Hold">
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                                <es:RegularPolygon Fill="#FFF4F4F5" Height="90" InnerRadius="0.47211" PointCount="5" Stretch="Fill" Stroke="Black" UseLayoutRounding="False" Width="84"/>
                                <StackPanel Orientation="Vertical" Margin="0,10,0,0">
                                    <TextBlock Text="{Binding Author}" TextWrapping="Wrap" FontSize="24"/>
                                    <TextBlock Text="{Binding Quote}" TextWrapping="NoWrap" FontSize="30" TextTrimming="WordEllipsis" Width="Auto" />

                                </StackPanel>
                            </StackPanel>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>
                <Button Content="Random Quote" Height="79" Margin="48,83,44,0" VerticalAlignment="Top" x:Name="quotSearch" Click="quotSearch_Click" />
            </Grid>
4

1 に答える 1

3

TextBox の Width プロパティを固定幅に変更する

<TextBlock Width="200" Height="75" TextWrapping="Wrap" Text="Click on Settings to search for quotes (by author or by query)." VerticalAlignment="Top" TextAlignment="Center" FontSize="26.667"/>
于 2012-04-29T07:44:07.403 に答える