-
Notifications
You must be signed in to change notification settings - Fork 63
Description
The contents of Custom Task Panes (CTP) containing WPF (UserControl) content disappear when closing a modified Word document. The add-in itself seems to remain loaded, and the space reserved for the CTP remains, but its contents are no longer available/updated.
This can be reproduced using the WordAddIn1 example that comes with VSTOContrib.
Steps to reproduce using the above add-in:
- Launch Word with test add-in containing a CTP loaded
- Open new, blank document
- Enter some text
- Select the text to have the add-in populate the CTP with content

- Click Cancel when the
"Do you want to save changes made to Document1"?dialog appears

- The CTP should have been blanked out during the previous step

- Note that the CTP content isn't updated/redrawn anymore [0]
[0] Clicking Show Panel in the add-in's Ribbon seems to indicate the CTP has been unloaded, as clicking it gives a NullReferenceException with myAddinTaskPane being null in the PanelShown property setter in DocumentViewModel.cs
Any ideas on how to prevent this from happening? Despite canceling the closing of the document or exiting of Word, it seems as though the CTP is being unloaded. The add-in only behaves normally after closing and relaunching Word.
Please let me know if additional information is required.
Thanks!