我有以下代码!我想知道是否有人知道如何在wpf中突出显示xps文件的文本?
感谢
using System.Windows.Xps.Packaging;
private void Window_Loaded(object sender, RoutedEventArgs e)
{
//Absolute Path works (below)
//var xpsDocument = new XpsDocument(@"C:\Users\..\Visual Studio 2008\Projects \MyProject\MyProject\Docs\MyDocument.xps", FileAccess.Read);
//Resource Path doesn't work (below)
var xpsDocument = new XpsDocument(@"\MyProject;component/Docs/Mydocument.xps", FileAccess.Read);
DocumentViewer.Document = xpsDocument.GetFixedDocumentSequence();
}