fernandreu / office-ribbonx-editor

An overhauled fork of the original Custom UI Editor for Microsoft Office, built with WPF
MIT License
513 stars 97 forks source link

InvalidOperationException: Cannot access part because parent package was closed. #229

Open JPluess opened 8 months ago

JPluess commented 8 months ago

Describe the bug

System.InvalidOperationException: Cannot access part because parent package was closed.
   at System.IO.Packaging.PackagePart.ThrowIfParentContainerClosed()
   at System.IO.Packaging.PackagePart.GetRelationshipHelper(String id)
   at System.IO.Packaging.PackagePart.RelationshipExists(String id)
   at OfficeRibbonXEditor.Documents.OfficePart.RemoveImage(String imageId) in C:\Users\FernA\agent\_work\1\s\src\OfficeRibbonXEditor\Documents\OfficePart.cs:line 149
   at OfficeRibbonXEditor.ViewModels.Documents.OfficePartViewModel.RemoveIcon(String id) in C:\Users\FernA\agent\_work\1\s\src\OfficeRibbonXEditor\ViewModels\Documents\OfficePartViewModel.cs:line 79
   at OfficeRibbonXEditor.ViewModels.Windows.MainWindowViewModel.ExecuteRemoveCommand() in C:\Users\FernA\agent\_work\1\s\src\OfficeRibbonXEditor\ViewModels\Windows\MainWindowViewModel.cs:line 562

To Reproduce Please describe the steps that lead to the unhandled exception here, including example files if relevant.

Screenshots If applicable, add screenshots to help explain how the unhandled exception occurred.

Additional context