|
@@ -425,7 +425,7 @@ namespace Avalonia.Controls
|
|
{
|
|
{
|
|
row.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
|
|
row.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
|
|
}
|
|
}
|
|
- UpdateDisplayedRows(DisplayData.FirstScrollingSlot, CellsHeight);
|
|
|
|
|
|
+ UpdateDisplayedRows(DisplayData.FirstScrollingSlot, CellsEstimatedHeight);
|
|
}
|
|
}
|
|
|
|
|
|
if (DisplayData.FirstScrollingSlot < slot && (DisplayData.LastScrollingSlot > slot || DisplayData.LastScrollingSlot == -1))
|
|
if (DisplayData.FirstScrollingSlot < slot && (DisplayData.LastScrollingSlot > slot || DisplayData.LastScrollingSlot == -1))
|
|
@@ -462,7 +462,7 @@ namespace Avalonia.Controls
|
|
ResetDisplayedRows();
|
|
ResetDisplayedRows();
|
|
}
|
|
}
|
|
NegVerticalOffset = 0;
|
|
NegVerticalOffset = 0;
|
|
- UpdateDisplayedRows(slot, CellsHeight);
|
|
|
|
|
|
+ UpdateDisplayedRows(slot, CellsEstimatedHeight);
|
|
}
|
|
}
|
|
else if (DisplayData.LastScrollingSlot <= slot)
|
|
else if (DisplayData.LastScrollingSlot <= slot)
|
|
{
|
|
{
|
|
@@ -502,11 +502,11 @@ namespace Avalonia.Controls
|
|
{
|
|
{
|
|
ResetDisplayedRows();
|
|
ResetDisplayedRows();
|
|
}
|
|
}
|
|
- if (MathUtilities.GreaterThanOrClose(GetExactSlotElementHeight(slot), CellsHeight))
|
|
|
|
|
|
+ if (MathUtilities.GreaterThanOrClose(GetExactSlotElementHeight(slot), CellsEstimatedHeight))
|
|
{
|
|
{
|
|
// The entire row won't fit in the DataGrid so we start showing it from the top
|
|
// The entire row won't fit in the DataGrid so we start showing it from the top
|
|
NegVerticalOffset = 0;
|
|
NegVerticalOffset = 0;
|
|
- UpdateDisplayedRows(slot, CellsHeight);
|
|
|
|
|
|
+ UpdateDisplayedRows(slot, CellsEstimatedHeight);
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
@@ -972,7 +972,7 @@ namespace Avalonia.Controls
|
|
|
|
|
|
if (isDisplayed)
|
|
if (isDisplayed)
|
|
{
|
|
{
|
|
- double availableHeight = CellsHeight - heightAboveStartSlot;
|
|
|
|
|
|
+ double availableHeight = CellsEstimatedHeight - heightAboveStartSlot;
|
|
// Actually expand the displayed slots up to what we can display
|
|
// Actually expand the displayed slots up to what we can display
|
|
for (int i = startSlot; (i <= endSlot) && (currentHeightChange < availableHeight); i++)
|
|
for (int i = startSlot; (i <= endSlot) && (currentHeightChange < availableHeight); i++)
|
|
{
|
|
{
|
|
@@ -1645,7 +1645,7 @@ namespace Avalonia.Controls
|
|
}
|
|
}
|
|
|
|
|
|
DisplayData.ClearElements(recycle: true);
|
|
DisplayData.ClearElements(recycle: true);
|
|
- AvailableSlotElementRoom = CellsHeight;
|
|
|
|
|
|
+ AvailableSlotElementRoom = CellsEstimatedHeight;
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
@@ -1662,7 +1662,7 @@ namespace Avalonia.Controls
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
else if (DisplayData.FirstScrollingSlot == -1 &&
|
|
else if (DisplayData.FirstScrollingSlot == -1 &&
|
|
- CellsHeight > 0 &&
|
|
|
|
|
|
+ CellsEstimatedHeight > 0 &&
|
|
CellsWidth > 0)
|
|
CellsWidth > 0)
|
|
{
|
|
{
|
|
return true;
|
|
return true;
|
|
@@ -1716,7 +1716,7 @@ namespace Avalonia.Controls
|
|
// Figure out what row we've scrolled down to and update the value for NegVerticalOffset
|
|
// Figure out what row we've scrolled down to and update the value for NegVerticalOffset
|
|
NegVerticalOffset = 0;
|
|
NegVerticalOffset = 0;
|
|
//
|
|
//
|
|
- if (height > 2 * CellsHeight &&
|
|
|
|
|
|
+ if (height > 2 * CellsEstimatedHeight &&
|
|
(RowDetailsVisibilityMode != DataGridRowDetailsVisibilityMode.VisibleWhenSelected || RowDetailsTemplate == null))
|
|
(RowDetailsVisibilityMode != DataGridRowDetailsVisibilityMode.VisibleWhenSelected || RowDetailsTemplate == null))
|
|
{
|
|
{
|
|
// Very large scroll occurred. Instead of determining the exact number of scrolled off rows,
|
|
// Very large scroll occurred. Instead of determining the exact number of scrolled off rows,
|
|
@@ -1778,7 +1778,7 @@ namespace Avalonia.Controls
|
|
NegVerticalOffset = 0;
|
|
NegVerticalOffset = 0;
|
|
//
|
|
//
|
|
|
|
|
|
- if (height < -2 * CellsHeight &&
|
|
|
|
|
|
+ if (height < -2 * CellsEstimatedHeight &&
|
|
(RowDetailsVisibilityMode != DataGridRowDetailsVisibilityMode.VisibleWhenSelected || RowDetailsTemplate == null))
|
|
(RowDetailsVisibilityMode != DataGridRowDetailsVisibilityMode.VisibleWhenSelected || RowDetailsTemplate == null))
|
|
{
|
|
{
|
|
// Very large scroll occurred. Instead of determining the exact number of scrolled off rows,
|
|
// Very large scroll occurred. Instead of determining the exact number of scrolled off rows,
|
|
@@ -1838,7 +1838,7 @@ namespace Avalonia.Controls
|
|
// strategy. For most data, this should be unnoticeable.
|
|
// strategy. For most data, this should be unnoticeable.
|
|
ResetDisplayedRows();
|
|
ResetDisplayedRows();
|
|
NegVerticalOffset = 0;
|
|
NegVerticalOffset = 0;
|
|
- UpdateDisplayedRows(0, CellsHeight);
|
|
|
|
|
|
+ UpdateDisplayedRows(0, CellsEstimatedHeight);
|
|
newFirstScrollingSlot = 0;
|
|
newFirstScrollingSlot = 0;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1857,7 +1857,7 @@ namespace Avalonia.Controls
|
|
NegVerticalOffset = 0;
|
|
NegVerticalOffset = 0;
|
|
}
|
|
}
|
|
|
|
|
|
- UpdateDisplayedRows(newFirstScrollingSlot, CellsHeight);
|
|
|
|
|
|
+ UpdateDisplayedRows(newFirstScrollingSlot, CellsEstimatedHeight);
|
|
|
|
|
|
double firstElementHeight = GetExactSlotElementHeight(DisplayData.FirstScrollingSlot);
|
|
double firstElementHeight = GetExactSlotElementHeight(DisplayData.FirstScrollingSlot);
|
|
if (MathUtilities.GreaterThan(NegVerticalOffset, firstElementHeight))
|
|
if (MathUtilities.GreaterThan(NegVerticalOffset, firstElementHeight))
|
|
@@ -1883,7 +1883,7 @@ namespace Avalonia.Controls
|
|
// We could be smarter about this, but it's not common so we wouldn't gain much from optimizing here
|
|
// We could be smarter about this, but it's not common so we wouldn't gain much from optimizing here
|
|
if (firstElementSlot != DisplayData.FirstScrollingSlot)
|
|
if (firstElementSlot != DisplayData.FirstScrollingSlot)
|
|
{
|
|
{
|
|
- UpdateDisplayedRows(firstElementSlot, CellsHeight);
|
|
|
|
|
|
+ UpdateDisplayedRows(firstElementSlot, CellsEstimatedHeight);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2011,7 +2011,7 @@ namespace Avalonia.Controls
|
|
DisplayData.ClearElements(recycle);
|
|
DisplayData.ClearElements(recycle);
|
|
|
|
|
|
// Update the AvailableRowRoom since we're displaying 0 rows now
|
|
// Update the AvailableRowRoom since we're displaying 0 rows now
|
|
- AvailableSlotElementRoom = CellsHeight;
|
|
|
|
|
|
+ AvailableSlotElementRoom = CellsEstimatedHeight;
|
|
VisibleSlotCount = 0;
|
|
VisibleSlotCount = 0;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2122,7 +2122,7 @@ namespace Avalonia.Controls
|
|
|
|
|
|
int lastDisplayedScrollingRow = newLastDisplayedScrollingRow;
|
|
int lastDisplayedScrollingRow = newLastDisplayedScrollingRow;
|
|
int firstDisplayedScrollingRow = -1;
|
|
int firstDisplayedScrollingRow = -1;
|
|
- double displayHeight = CellsHeight;
|
|
|
|
|
|
+ double displayHeight = CellsEstimatedHeight;
|
|
double deltaY = 0;
|
|
double deltaY = 0;
|
|
int visibleScrollingRows = 0;
|
|
int visibleScrollingRows = 0;
|
|
|
|
|
|
@@ -2633,7 +2633,7 @@ namespace Avalonia.Controls
|
|
}
|
|
}
|
|
if (isDisplayed)
|
|
if (isDisplayed)
|
|
{
|
|
{
|
|
- UpdateDisplayedRows(DisplayData.FirstScrollingSlot, CellsHeight);
|
|
|
|
|
|
+ UpdateDisplayedRows(DisplayData.FirstScrollingSlot, CellsEstimatedHeight);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else
|
|
else
|
|
@@ -2692,7 +2692,7 @@ namespace Avalonia.Controls
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- UpdateDisplayedRows(newFirstScrollingSlot, CellsHeight);
|
|
|
|
|
|
+ UpdateDisplayedRows(newFirstScrollingSlot, CellsEstimatedHeight);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -2736,7 +2736,7 @@ namespace Avalonia.Controls
|
|
NegVerticalOffset = 0;
|
|
NegVerticalOffset = 0;
|
|
SetVerticalOffset(0);
|
|
SetVerticalOffset(0);
|
|
int firstDisplayedRow = GetNextVisibleSlot(-1);
|
|
int firstDisplayedRow = GetNextVisibleSlot(-1);
|
|
- UpdateDisplayedRows(firstDisplayedRow, CellsHeight);
|
|
|
|
|
|
+ UpdateDisplayedRows(firstDisplayedRow, CellsEstimatedHeight);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|