我在Log上的项目消息中有:
对象错误,ID = {488DB9A2-6C4C-4E06-887E-6D35C6D538CA}
我希望像你看到的那样将这个guid显示为超链接。我用简单的文本和链接创建了TextBlock。
public TextBlock InitTextBlock(string message)
{
var textBlock = new TextBlock();
var strs = ParseByGuid(Message);
foreach (var str in strs)
{
var run = new Run(str.Text);
if (str.IsLink)
textBlock.Inlines.Add(new Hyperlink(run));
else
textBlock.Inlines.Add(run);
}
return textBlock;
}
但我需要将TextBlock放在DataGrid中,或者可能是另一个控件。