首先添加上角标
Button button = new Button();
Run left=new Run("x");
Run right = new Run("2");
right.BaselineAlignment=BaselineAlignment.Superscript;
TextBlock textBlock = new TextBlock();
textBlock.Inlines.Add(left);
textBlock.Inlines.Add(right);
button.Content = textBlock;
