
How should I dispose SyntaxEditor when the tab is closed.
I have injected many services in SyntaxEditor.Document.Language, and I want to know under what circumstances they will be destroyed
How should I dispose SyntaxEditor when the tab is closed.
I have injected many services in SyntaxEditor.Document.Language, and I want to know under what circumstances they will be destroyed
Hello,
You shouldn't generally need to do anything special in WPF because the whole tree of objects would disappear from memory when no longer in use.
You could set the SyntaxEditor.Document.Language back to SyntaxLanguage.PlainText once the tab closes. That should trigger things like taggers, etc. that were created specifically for a document/view by your language services to detach themselves from the document/view. Again that normally isn't necessary though unless some of those objects created are tied to some external resources you have.
Please log in to a validated account to post comments.