void header_Delete(object sender, RoutedEventArgs e) { //-->删除当前点击的TabItem TabItemHeader btn = sender as TabItemHeader; if (null == btn || null == btn.Tag) { return; } TabItem ti = btn.Tag as TabItem; PageWorkArea pwa = ti.Content as PageWorkArea; pwa.ControlPosition -= pwa_ControlPosition; pwa.ContentUpdate -= pwa_ContentUpdate; pwa.Dispose(); pwa.ParentControl = null; pwa = null; btn.OnCloseTabItem -= header_Delete; tcCollection.Items.Remove(ti); ti.Content = null; ti = null; var cpwa = CurrentPageWorkArea; if (null == cpwa) { //-->清空属性控件,和文本大刚。 if (null != OnClear) { OnClear(this, null); } return; } //-->更新当前的属性控件 //-->更新文本大刚 CurrentPageWorkArea.UpdatePropertyGridAndControlTree(); }