internal void AddRecylableRow(DataGridRow row)
 {
     Debug.Assert(!_recyclableRows.Contains(row));
     row.DetachFromDataGrid(true);
     _recyclableRows.Push(row);
 }
        private void UnloadRow(DataGridRow dataGridRow)
        {
            Debug.Assert(dataGridRow != null);
            Debug.Assert(this._rowsPresenter != null);
            Debug.Assert(this._rowsPresenter.Children.Contains(dataGridRow));

            if (this._loadedRows.Contains(dataGridRow))
            {
                return; // The row is still referenced, we can't release it.
            }

            // Raise UnloadingRow regardless of whether the row will be recycled
            OnUnloadingRow(new DataGridRowEventArgs(dataGridRow));

            // 
            bool recycleRow = this.CurrentSlot != dataGridRow.Index;

            // Don't recycle if the row has a custom Style set
            recycleRow &= (dataGridRow.Style == null || dataGridRow.Style == this.RowStyle);

            if (recycleRow)
            {
                this.DisplayData.AddRecylableRow(dataGridRow);
            }
            else
            {
                // 
                this._rowsPresenter.Children.Remove(dataGridRow);
                dataGridRow.DetachFromDataGrid(false);
            }
        }
Esempio n. 3
0
 internal void AddRecylableRow(DataGridRow row)
 {
     Debug.Assert(!_recyclableRows.Contains(row));
     row.DetachFromDataGrid(true);
     _recyclableRows.Push(row);
 }