/// <summary> /// this is called by our model, as a result of a "SelectedTabChangedEvent". So it's a lot more reliable than the normal winforms one. /// </summary> public void OnVisibleChanged(bool visible) { _visible = visible; if (visible) { if (_model.GetBookHasChanged()) { //now we're doing it based on the focus textarea: ShowOrHideSourcePane(_model.ShowTranslationPanel); SetTranslationPanelVisibility(); //even before showing, we need to clear some things so the user doesn't see the old stuff _pageListView.Clear(); _templatePagesView.Clear(); } Application.Idle += new EventHandler(VisibleNowAddSlowContents); Cursor = Cursors.WaitCursor; Logger.WriteEvent("Entered Edit Tab"); } else { Application.Idle -= new EventHandler(VisibleNowAddSlowContents); //make sure _browser1.Navigate("about:blank", false); //so we don't see the old one for moment, the next time we open this tab } }