public static void OnDestroy(object documentContentOrDocumentViewModel) { IDocumentContent documentContent = documentContentOrDocumentViewModel as IDocumentContent; if (documentContent != null) { documentContent.OnDestroy(); } }
void form_Closed(object sender, EventArgs e) { owner.RemoveDocument(this); formCore.Closing -= form_Closing; formCore.Closed -= form_Closed; IDocumentContent documentContent = GetContent() as IDocumentContent; if (documentContent != null) { documentContent.OnDestroy(); } }