本文整理汇总了C#中System.Windows.Documents.Paragraph.ReplaceLabelWithLargeImage方法的典型用法代码示例。如果您正苦于以下问题:C# Paragraph.ReplaceLabelWithLargeImage方法的具体用法?C# Paragraph.ReplaceLabelWithLargeImage怎么用?C# Paragraph.ReplaceLabelWithLargeImage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Documents.Paragraph
的用法示例。
在下文中一共展示了Paragraph.ReplaceLabelWithLargeImage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FillRichTextBox
private async System.Threading.Tasks.Task FillRichTextBox(string text)
{
var start = 0;
var regex = new Regex("(\\$[^\\$]+?\\$)|(\\$\\$[^\\$]+?\\$\\$)");
var paragraph = new Paragraph();
foreach (Match match in regex.Matches(text))
{
var matchVal = match.Value;
var notInline = matchVal.StartsWith("$$");
var imageId = notInline
? match.Value.Substring(3, match.Value.Length - 6)
: match.Value.Substring(2, match.Value.Length - 4);
paragraph.AddText(start, match.Index, text);
if (notInline)
{
MathQuestionBox.Blocks.Add(paragraph);
var imgParagraph = new Paragraph();
await imgParagraph.ReplaceLabelWithLargeImage(imageId);
MathQuestionBox.Blocks.Add(imgParagraph);
paragraph = new Paragraph();
}
else
{
await paragraph.ReplaceLabelWithImage(imageId);
}
start = match.Index + match.Length;
}
paragraph.AddText(start, text.Length, text);
//App.ViewModel.Blocks.Add(paragraph);
MathQuestionBox.Blocks.Add(paragraph);
}