문제

I converted an XpsDocument to FixedDocumentSequence (in a converter) using myXpsDocument.GetFixedDocumentSequence(); method .

Now I need the XpsDocument.Uri in code behind to release its file lock :

System.IO.Packaging.PackageStore.GetPackage(xpsUri).Close();
System.IO.Packaging.PackageStore.RemovePackage(xpsUri);

And problem is : How can I access the XpsDocument (or its Uri) in Code behind.

도움이 되었습니까?

해결책

Instead of disposing it from code behind, you should dispose it as soon as you get it converted to FixedDocumentSequence may be inside converter only since no need to hold onto it once it gets converted to fixed document sequence.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top