void ContentFrame_Disposed(object sender, EventArgs e) { HConnection.RemoveByKey -= HConnection_RemoveByKey; HUsage.ClosingApp -= HUsage_ClosingApp; if (ParentFrame != null) { var pf = ParentFrame; MainWindow.Instance.RunInMainWindow(() => pf.NotifyDisposed(this)); } Usage.Dispose(); }
protected override void OnFormClosed(FormClosedEventArgs e) { base.OnFormClosed(e); Usage.Dispose(); HUsage.ClosingApp -= HUsage_ClosingApp; }