上标不会进入wpf richtext框

use*_*971 6 c# wpf richtextbox mvvm

我在wpf mvvm应用程序中实现了一个自定义的富文本框,并且可以选择格式化输入的文本,如下所示:

<Button Style="{StaticResource formatTextStyle}"
        Command="EditingCommands.ToggleBold" ToolTip="Bold">
   <TextBlock FontWeight="Bold">B</TextBlock>
</Button>
Run Code Online (Sandbox Code Playgroud)

我正在使用EditingCommands.ToggleBold使文本变为粗体.以同样的方式,我给出了ToggleSuperscript的选项

<Button Style="{StaticResource formatImageStyle}" 
        Command="EditingCommands.ToggleSuperscript" ToolTip="Superscript">
   <TextBlock FontStyle="Italic" FontWeight="Bold">SubScript</TextBlock>
</Button>
Run Code Online (Sandbox Code Playgroud)

但它不起作用......

这里是StaticResource

<Style TargetType="{x:Type Button}" x:Key="formatTextStyle">
   <Setter Property="FontFamily" Value="Palatino Linotype"></Setter>
   <Setter Property="Width" Value="30"></Setter>
   <Setter Property="FontSize" Value ="14"></Setter>
   <Setter Property="CommandTarget" Value="{Binding ElementName=mainRTB}"/>
</Style>
Run Code Online (Sandbox Code Playgroud)

和mainRTB是我的RichTextBox名称.

<RichTextBox Name="mainRTB" AcceptsTab="True" Height="160"
             asis:RichTextboxAssistant.BoundDocument="{Binding Path=Text, 
                                             ElementName=uxRichTextEditor}"
             VerticalScrollBarVisibility="Visible" />
Run Code Online (Sandbox Code Playgroud)

我对此毫无头绪.任何机构都可以建议如何启用ToggleSuperscript和ToggleSubscript.

Sha*_*yar 0

使用Typography.variants

<Paragraph FontFamily="Palatino Linotype">
  2<Run Typography.Variants="Superscript">3</Run>
  14<Run Typography.Variants="Superscript">th</Run>
</Paragraph>
Run Code Online (Sandbox Code Playgroud)