public void SetFormattedText(FormattedText text) { var formattedLabel = new System.Windows.Controls.TextBlock(); formattedLabel.ApplyFormattedText(text, null); this.menuItem.Header = formattedLabel; }
public void SetFormattedText(FormattedText text) { SWC.Label labelCtrl = null; if (Button.Content is SWC.DockPanel) { var grid = Button.Content as SWC.DockPanel; labelCtrl = grid.Children[1] as SWC.Label; } else { labelCtrl = new SWC.Label(); Button.Content = labelCtrl; } var textCtrl = new SWC.TextBlock(); textCtrl.ApplyFormattedText(text, null); labelCtrl.Content = textCtrl; }