Hi, I added a custome user control into a scroll viewer as a new document, the container mode is MDI, when I close the document via clicking X button on right-top corner, the event CloseButtonClick will be triggered, the event TabClosed won't be triggered. When I close the document via clicking menu item "Close", I cannot capture the CloseButtonClick and TabClosed event. What can I do to get the close event when I close the document via clicking "Close" menu item.
Another problem, I defined a user control, added it into document container, after I closed the document contains custome user control, I checked the document container, found that the count of document container's items is not reduced. Is it a bug?
I uploaded a demo for you to reproduce it, the reproduce steps:
1. Startup the pragram
2. Click menu item "
Check Documents Count" in Windows menu, message box pops up
3. Close the message window
4. Click menu item "
New Document" in Windows menu, a new document will display
5. Close the new document
6. Click menu item "
Check Documents Count" again
7. The count of DockingManager.DocContainer.Items is not reduced
Attachment:
MDI_2b0a06ae.zip