//------------------------------------------------------------------- // // Internal Methods / Properties // //------------------------------------------------------------------- #region Internal Methods /// <summary> /// process the column collection chagned event /// </summary> internal virtual void OnColumnCollectionChanged(GridViewColumnCollectionChangedEventArgs e) { if (DesiredWidthList != null) { if (e.Action == NotifyCollectionChangedAction.Remove || e.Action == NotifyCollectionChangedAction.Replace) { // NOTE: The steps to make DesiredWidthList.Count <= e.ActualIndex // // 1. init with 3 auto columns; // 2. add 1 column to the column collection with width 90.0; // 3. remove the column we jsut added to the the collection; // // Now we have DesiredWidthList.Count equals to 3 while the removed column // has ActualIndex equals to 3. // if (DesiredWidthList.Count > e.ActualIndex) { DesiredWidthList.RemoveAt(e.ActualIndex); } } else if (e.Action == NotifyCollectionChangedAction.Reset) { DesiredWidthList = null; } } }
// Token: 0x06005E0D RID: 24077 RVA: 0x001A7158 File Offset: 0x001A5358 private void ColumnCollectionChanged(object sender, NotifyCollectionChangedEventArgs arg) { GridViewColumnCollectionChangedEventArgs gridViewColumnCollectionChangedEventArgs = arg as GridViewColumnCollectionChangedEventArgs; if (gridViewColumnCollectionChangedEventArgs != null && this.IsPresenterVisualReady) { if (gridViewColumnCollectionChangedEventArgs.Column != null) { this.OnColumnPropertyChanged(gridViewColumnCollectionChangedEventArgs.Column, gridViewColumnCollectionChangedEventArgs.PropertyName); return; } this.OnColumnCollectionChanged(gridViewColumnCollectionChangedEventArgs); } }
/// <summary> /// Handler of GridViewColumnCollection.CollectionChanged event. /// </summary> private void ColumnCollectionChanged(object sender, NotifyCollectionChangedEventArgs arg) { GridViewColumnCollectionChangedEventArgs e = arg as GridViewColumnCollectionChangedEventArgs; if (e != null && IsPresenterVisualReady) // if and only if rowpresenter's visual is ready, shall rowpresenter go ahead process the event. { // Property of one column changed if (e.Column != null) { OnColumnPropertyChanged(e.Column, e.PropertyName); } else { OnColumnCollectionChanged(e); } } }
// Token: 0x06005E01 RID: 24065 RVA: 0x001A6F88 File Offset: 0x001A5188 internal virtual void OnColumnCollectionChanged(GridViewColumnCollectionChangedEventArgs e) { if (this.DesiredWidthList != null) { if (e.Action == NotifyCollectionChangedAction.Remove || e.Action == NotifyCollectionChangedAction.Replace) { if (this.DesiredWidthList.Count > e.ActualIndex) { this.DesiredWidthList.RemoveAt(e.ActualIndex); return; } } else if (e.Action == NotifyCollectionChangedAction.Reset) { this.DesiredWidthList = null; } } }
//------------------------------------------------------------------- // // Internal Methods / Properties // //-------------------------------------------------------------------- #region Internal Methods /// <summary> /// process the column collection chagned event /// </summary> internal virtual void OnColumnCollectionChanged(GridViewColumnCollectionChangedEventArgs e) { if (DesiredWidthList != null) { if (e.Action == NotifyCollectionChangedAction.Remove || e.Action == NotifyCollectionChangedAction.Replace) { // NOTE: The steps to make DesiredWidthList.Count <= e.ActualIndex // // 1. init with 3 auto columns; // 2. add 1 column to the column collection with width 90.0; // 3. remove the column we jsut added to the the collection; // // Now we have DesiredWidthList.Count equals to 3 while the removed column // has ActualIndex equals to 3. // if (DesiredWidthList.Count > e.ActualIndex) { DesiredWidthList.RemoveAt(e.ActualIndex); } } else if (e.Action == NotifyCollectionChangedAction.Reset) { DesiredWidthList = null; } } }