internal void OnSectionRemoved(GroupViewSection section) { if (section == this._selectedSection) { int selectedSectionIndex = this.SelectedSectionIndex; if (selectedSectionIndex == this._sectionCollection.Count) { selectedSectionIndex--; } this.SelectedSectionIndex = selectedSectionIndex; } else { for (int i = 0; i < this._sectionCollection.Count; i++) { if (this._sectionCollection[i] == this._selectedSection) { this.SelectedSectionIndex = i; } } } section.SetOwner(null); }
internal void OnSectionAdded(GroupViewSection section) { section.SetOwner(this); if ((this._selectedSectionIndex == -1) && section.Visible) { this.SelectedSectionIndex = 0; } }