private void RaiseLineArranged() { var realizationRect = RealizationRect; if (realizationRect.Width != 0.0f || realizationRect.Height != 0.0f) { int realizedElementCount = _elementManager.GetRealizedElementCount(); if (realizedElementCount > 0) { int countInLine = 0; var previousElementBounds = _elementManager.GetLayoutBoundsForDataIndex(_firstRealizedDataIndexInsideRealizationWindow); var currentLineOffset = _orientation.MajorStart(previousElementBounds); var currentLineSize = _orientation.MajorSize(previousElementBounds); for (int currentDataIndex = _firstRealizedDataIndexInsideRealizationWindow; currentDataIndex <= _lastRealizedDataIndexInsideRealizationWindow; currentDataIndex++) { var currentBounds = _elementManager.GetLayoutBoundsForDataIndex(currentDataIndex); if (_orientation.MajorStart(currentBounds) != currentLineOffset) { // Staring a new line _algorithmCallbacks.Algorithm_OnLineArranged(currentDataIndex - countInLine, countInLine, currentLineSize, _context); countInLine = 0; currentLineOffset = _orientation.MajorStart(currentBounds); currentLineSize = 0; } currentLineSize = Math.Max(currentLineSize, _orientation.MajorSize(currentBounds)); countInLine++; previousElementBounds = currentBounds; } // Raise for the last line. _algorithmCallbacks.Algorithm_OnLineArranged(_lastRealizedDataIndexInsideRealizationWindow - countInLine + 1, countInLine, currentLineSize, _context); } } }
void RaiseLineArranged() { var realizationRect = RealizationRect; if (realizationRect.Width != 0.0f || realizationRect.Height != 0.0f) { int realizedElementCount = m_elementManager.GetRealizedElementCount; if (realizedElementCount > 0) { global::System.Diagnostics.Debug.Assert(m_firstRealizedDataIndexInsideRealizationWindow != -1 && m_lastRealizedDataIndexInsideRealizationWindow != -1); int countInLine = 0; var previousElementBounds = m_elementManager.GetLayoutBoundsForDataIndex(m_firstRealizedDataIndexInsideRealizationWindow); var currentLineOffset = MajorStart(previousElementBounds); var currentLineSize = MajorSize(previousElementBounds); for (int currentDataIndex = m_firstRealizedDataIndexInsideRealizationWindow; currentDataIndex <= m_lastRealizedDataIndexInsideRealizationWindow; currentDataIndex++) { var currentBounds = m_elementManager.GetLayoutBoundsForDataIndex(currentDataIndex); if (MajorStart(currentBounds) != currentLineOffset) { // Staring a new line m_algorithmCallbacks.Algorithm_OnLineArranged(currentDataIndex - countInLine, countInLine, currentLineSize, m_context); countInLine = 0; currentLineOffset = MajorStart(currentBounds); currentLineSize = 0; } currentLineSize = Math.Max((float)(currentLineSize), MajorSize(currentBounds)); countInLine++; previousElementBounds = currentBounds; } // Raise for the last line. m_algorithmCallbacks.Algorithm_OnLineArranged(m_lastRealizedDataIndexInsideRealizationWindow - countInLine + 1, countInLine, currentLineSize, m_context); } } }