//File:Window.xaml.vb Imports System Imports System.IO Imports System.Windows Imports System.Windows.Documents Imports System.Windows.Markup Imports System.Windows.Xps.Packaging Imports System.Xml Imports Microsoft.Win32 Namespace WpfApplication1 Public Partial Class Window1 Inherits Window Public Sub New() InitializeComponent() End Sub Private Sub btnOpenFlowDoc_Click(sender As Object, e As RoutedEventArgs) Dim file__1 As Stream = InlineAssignHelper(file__1, File.OpenRead("c:\b.xps")) Dim reader As TextReader = New StreamReader(file__1) Dim xmlReader As New XmlTextReader(reader) Dim flowDocument As FlowDocument = TryCast(XamlReader.Load(xmlReader), FlowDocument) dvDocumentViewer.Document = flowDocument End Sub Private Shared Function InlineAssignHelper(Of T)(ByRef target As T, value As T) As T target = value Return value End Function End Class End Namespace