I have a simple RadPdfViewer declared in my UserControl:
Randomly (although it appears that this exception does not occur if I wait for the current document to be fully rendered and the progress indicator to be removed by the RadPdfViewer) when "Uri" property in my VM (which is a simple string property) is changed to new Uri of some pdf file I get ObjectDisposedException with "Cannot access a closed file." message.
StackTrace:
at System.IO.__Error.FileNotOpen()
at System.IO.FileStream.get_Position()
at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfReader.Readers.PdfReaderBase.ReadInternal() in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Documents\Fixed\Core\FormatProviders\Pdf\PdfReader\Readers\PdfReaderBase.cs:line 174
Exception Detail:
System.ObjectDisposedException occurred
HResult=-2146232798
Message=Cannot access a closed file.
Source=mscorlib
ObjectName=""
StackTrace:
at System.IO.__Error.FileNotOpen()
at System.IO.FileStream.get_Position()
at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfReader.Readers.PdfReaderBase.get_Position() in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Documents\Fixed\Core\FormatProviders\Pdf\PdfReader\Readers\PdfReaderBase.cs:line 55
InnerException:
Could you please take a look?
<t:RadPdfViewer Grid.Row="1" x:Name="PdfViewer" DocumentSource="{Binding Uri}" PreviewKeyDown="PdfViewer_OnPreviewKeyDown" DocumentChanged="PdfViewer_OnDocumentChanged"/>
Randomly (although it appears that this exception does not occur if I wait for the current document to be fully rendered and the progress indicator to be removed by the RadPdfViewer) when "Uri" property in my VM (which is a simple string property) is changed to new Uri of some pdf file I get ObjectDisposedException with "Cannot access a closed file." message.
StackTrace:
at System.IO.__Error.FileNotOpen()
at System.IO.FileStream.get_Position()
at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfReader.Readers.PdfReaderBase.ReadInternal() in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Documents\Fixed\Core\FormatProviders\Pdf\PdfReader\Readers\PdfReaderBase.cs:line 174
Exception Detail:
System.ObjectDisposedException occurred
HResult=-2146232798
Message=Cannot access a closed file.
Source=mscorlib
ObjectName=""
StackTrace:
at System.IO.__Error.FileNotOpen()
at System.IO.FileStream.get_Position()
at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfReader.Readers.PdfReaderBase.get_Position() in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Documents\Fixed\Core\FormatProviders\Pdf\PdfReader\Readers\PdfReaderBase.cs:line 55
InnerException:
Could you please take a look?