/// <summary>Prepares the specified element to display the specified item. </summary> /// <param name="element">Element used to display the specified item.</param> /// <param name="item">Specified item.</param> // Token: 0x06005CF6 RID: 23798 RVA: 0x001A2768 File Offset: 0x001A0968 protected override void PrepareContainerForItemOverride(DependencyObject element, object item) { DataGridColumnHeader dataGridColumnHeader = element as DataGridColumnHeader; if (dataGridColumnHeader != null) { DataGridColumn column = this.ColumnFromContainer(dataGridColumnHeader); if (dataGridColumnHeader.Column == null) { dataGridColumnHeader.Tracker.StartTracking(ref this._headerTrackingRoot); } dataGridColumnHeader.PrepareColumnHeader(item, column); } }
/// <summary> /// Prepares a new container for a given item. /// </summary> /// <remarks>We do not want to call base.PrepareContainerForItemOverride in this override because it will set local values on the header</remarks> /// <param name="element">The new container.</param> /// <param name="item">The item that the container represents.</param> protected override void PrepareContainerForItemOverride(DependencyObject element, object item) { DataGridColumnHeader header = element as DataGridColumnHeader; if (header != null) { DataGridColumn column = ColumnFromContainer(header); Debug.Assert(column != null, "We shouldn't have generated this column header if we don't have a column."); if (header.Column == null) { // A null column means this is a fresh container. PrepareContainer will also be called simply if the column's // Header property has changed and this container needs to be given a new item. In that case it'll already be tracked. header.Tracker.Debug_AssertNotInList(_headerTrackingRoot); header.Tracker.StartTracking(ref _headerTrackingRoot); } header.Tracker.Debug_AssertIsInList(_headerTrackingRoot); header.PrepareColumnHeader(item, column); } }