Skip to main content
 首页 » 编程设计

c#之带有 TextBlock 的 BulletDecorator 不显示 Unicode 字符

2024年02月13日13lhb25

知道为什么这不能按预期工作吗?
在运行时,我们的 WPF 应用程序的输出字面上显示 \u2022 序列..而我期望的是项目符号字符 (Unicode Character 'BULLET' (U+2022)):

    <BulletDecorator VerticalAlignment="Center" > 
        <BulletDecorator.Bullet> 
            <TextBlock Text="\u2022"/> 
        </BulletDecorator.Bullet> 
        <TextBox Style="{StaticResource ReadOnlyTextBoxStyle}"  
             TextWrapping="WrapWithOverflow"  
             Text="{Binding Name, Mode=OneWay}"/> 
    </BulletDecorator> 

请您参考如下方法:

没关系 - 以下格式有效:

<TextBlock Text="&#x2022;"/>