突出显示xps文件

时间:2011-10-04 15:22:40

标签: wpf

我有以下代码!我想知道是否有人知道如何在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();
    }

0 个答案:

没有答案