internal void ScrollIndexIntoView(ScrollIntoViewOperation <int> operation) { var index = operation.RequestedItem; var frozenContainersLength = Math.Max(0, this.RowPool.FrozenContainersLength); var itemLength = this.rowLayout.RenderInfo.ValueForIndex(index); var offsetToScroll = this.rowLayout.RenderInfo.OffsetFromIndex(index) - itemLength; if (DoubleArithmetics.IsLessThan(operation.InitialScrollOffset + frozenContainersLength, offsetToScroll)) { if (index > 0) { offsetToScroll -= this.View.ViewportHeight; offsetToScroll += itemLength; } } else if (DoubleArithmetics.IsLessThanOrEqual(offsetToScroll, operation.InitialScrollOffset + frozenContainersLength)) { offsetToScroll -= frozenContainersLength; } var scrollPosition = new RadPoint(this.PhysicalHorizontalOffset, Math.Max(0, offsetToScroll)); this.GridView.SetScrollPosition(scrollPosition, true, true); }
private void RadListViewItem_SizeChanged(object sender, Windows.UI.Xaml.SizeChangedEventArgs e) { var aritmetics = new DoubleArithmetics(1); if (!aritmetics.AreClose(e.PreviousSize, e.NewSize) && !this.isReordering) { this.Owner.UpdateService.RegisterUpdate(new DelegateUpdate <UpdateFlags>(() => this.ListView.contentPanel.InvalidateMeasure())); this.needUpdate = false; } }
internal bool IsColumnIndexInView(ScrollIntoViewOperation <int> operation) { var column = this.ColumnPool.GetDisplayedElement(operation.RequestedItem); if (column == null) { return(false); } // Since the headers are not part of the scrollviewer we need to compare their position to the viewport window and omit the scroll offset. return(DoubleArithmetics.Ceiling(column.LayoutSlot.X) >= 0 && DoubleArithmetics.IsLessThanOrEqual(column.LayoutSlot.X + column.layoutSlot.Width, this.View.ViewportWidth)); }
internal bool IsIndexInView(ScrollIntoViewOperation <int> operation) { var layoutSlot = this.RowPool.GetPreviousDisplayedLayoutSlot(operation.RequestedItem); if (layoutSlot == RadRect.Invalid) { return(false); } var frozenContainersLength = Math.Max(0, this.RowPool.FrozenContainersLength); return(DoubleArithmetics.IsGreaterThanOrEqual(layoutSlot.Y, this.PhysicalVerticalOffset + frozenContainersLength) && DoubleArithmetics.IsLessThanOrEqual(layoutSlot.Y + layoutSlot.Height, this.PhysicalVerticalOffset + this.View.ViewportHeight)); }