private void CaculateRecordIndexRatio() { var totalRecordsCount = Math.Round((totalHeight) / rowHeight); double rowStartHeight = 0; for (var index = 1; index <= totalRecordsCount; index++) { var rowInfoModel = new RowInfoModel() { RowIndex = index, StartValue = rowStartHeight, EndValue = rowHeight * index }; TotalRowCollection.Add(index, rowInfoModel); rowStartHeight = rowHeight * index; } }
public void CalculateVisibleRowsCalculation() { if (VisibleRowCollection == null) { VisibleRowCollection = new Dictionary <int, RowInfoModel>(); } var visibleRecordsCount = Math.Round((viewPortHeight) / rowHeight); double rowStartHeight = 0; for (var index = 1; index <= visibleRecordsCount; index++) { var rowInfoModel = new RowInfoModel() { RowIndex = index, StartValue = rowStartHeight, EndValue = rowHeight * index }; VisibleRowCollection.Add(index, rowInfoModel); rowStartHeight = rowHeight * index; } }
private bool CheckNumnber(RowInfoModel rowData, double checkableValue) { return(checkableValue > rowData.StartValue && checkableValue > rowData.EndValue); }
private bool GetNewRowIndex(RowInfoModel rowData, double checkableValue) { return(checkableValue > rowData.StartValue && checkableValue <= rowData.EndValue); }