Example #1
0
 private void HookContext(DependencyObject oldOwner, DependencyObject newOwner)
 {
     if (newOwner != null)
     {
         foreach (var column in this._stableColumns)
         {
             InheritanceContextHelper.ProvideContextForObject(newOwner, column);
         }
     }
     else
     {
         foreach (var column in this._stableColumns)
         {
             InheritanceContextHelper.RemoveContextFromObject(oldOwner, column);
         }
     }
 }
Example #2
0
        private TreeGridColumnCollectionChangedEventArgs RemoveAtPreprocess(int index)
        {
            this.VerifyIndexInRange(index, "index");

            int actualIndex = this._stableIndices[index];
            var column      = this._stableColumns[actualIndex];

            column.ResetPrivateData();
            column.PropertyChanged -= this.ColumnPropertyChanged;

            this._stableColumns.RemoveAt(actualIndex);

            this.UpdateIndicesOnRemoved(actualIndex, index);

            InheritanceContextHelper.RemoveContextFromObject(this._owner, column);

            return(new TreeGridColumnCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, column, index, actualIndex));
        }
Example #3
0
        private TreeGridColumnCollectionChangedEventArgs ClearPreprocess()
        {
            var array = new TreeGridColumn[base.Count];

            if (base.Count > 0)
            {
                base.CopyTo(array, 0);
            }

            foreach (var column in this._stableColumns)
            {
                column.ResetPrivateData();
                column.PropertyChanged -= this.ColumnPropertyChanged;
                InheritanceContextHelper.RemoveContextFromObject(this._owner, column);
            }

            this._stableColumns.Clear();
            this._stableIndices.Clear();

            return(new TreeGridColumnCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset, array));
        }