internal DataGridRowGroupHeader GetUsedGroupHeader()
 {
     if (_recyclableGroupHeaders.Count > 0)
     {
         return(_recyclableGroupHeaders.Pop());
     }
     else if (_fullyRecycledGroupHeaders.Count > 0)
     {
         // For fully recycled rows, we need to set the Visibility back to Visible
         DataGridRowGroupHeader groupHeader = _fullyRecycledGroupHeaders.Pop();
         groupHeader.IsVisible = true;
         return(groupHeader);
     }
     return(null);
 }
        private static double ValidateSublevelIndent(DataGridRowGroupHeader header, double value)
        {
            // We don't need to revert to the old value if our input is bad because we never read this property value
            if (double.IsNaN(value))
            {
                throw DataGridError.DataGrid.ValueCannotBeSetToNAN(nameof(SublevelIndent));
            }
            else if (double.IsInfinity(value))
            {
                throw DataGridError.DataGrid.ValueCannotBeSetToInfinity(nameof(SublevelIndent));
            }
            else if (value < 0)
            {
                throw DataGridError.DataGrid.ValueMustBeGreaterThanOrEqualTo(nameof(value), nameof(SublevelIndent), 0);
            }

            return(value);
        }
 internal void FullyRecycleElements()
 {
     // Fully recycle Recycleable rows and transfer them to Recycled rows
     while (_recyclableRows.Count > 0)
     {
         DataGridRow row = _recyclableRows.Pop();
         Debug.Assert(row != null);
         row.IsVisible = false;
         Debug.Assert(!_fullyRecycledRows.Contains(row));
         _fullyRecycledRows.Push(row);
     }
     // Fully recycle Recycleable GroupHeaders and transfer them to Recycled GroupHeaders
     while (_recyclableGroupHeaders.Count > 0)
     {
         DataGridRowGroupHeader groupHeader = _recyclableGroupHeaders.Pop();
         Debug.Assert(groupHeader != null);
         groupHeader.IsVisible = false;
         Debug.Assert(!_fullyRecycledGroupHeaders.Contains(groupHeader));
         _fullyRecycledGroupHeaders.Push(groupHeader);
     }
 }
 internal void AddRecylableRowGroupHeader(DataGridRowGroupHeader groupHeader)
 {
     Debug.Assert(!_recyclableGroupHeaders.Contains(groupHeader));
     groupHeader.IsRecycled = true;
     _recyclableGroupHeaders.Push(groupHeader);
 }
Example #5
0
 /// <summary>
 /// Constructs a DataGridRowGroupHeaderEventArgs instance
 /// </summary>
 /// <param name="rowGroupHeader"></param>
 public DataGridRowGroupHeaderEventArgs(DataGridRowGroupHeader rowGroupHeader)
 {
     RowGroupHeader = rowGroupHeader;
 }