RadCanvasViewport
An IRadScrollViewport implementation whose extent is the bounding rectangle enclosing all non-collapsed child elements, allowing content to be scrolled freely on the pixel (canvas) coordinate system.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
public class RadCanvasViewport : RadElement, IDisposable, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IStylableNode, IRadScrollViewport
Inheritance: objectDisposableObjectRadObjectRadElementRadCanvasViewport
Derived Classes:
Implements:
Inherited Members
Constructors
public RadCanvasViewport()
Properties
Gets the size of the rectangle that bounds all non-collapsed children of this viewport; recomputed lazily whenever the children collection changes. The setter is a no-op in release builds.
public Size CanvasSize { get; set; }
Methods
Calculates the canvas extent from eligible child bounds, including each child's margins. Children that are auto-sized with FitToAvailableSize are excluded.
protected virtual Size CalcCanvasSize()
The size required to enclose the included child elements.
Applies physical scrolling by offsetting the rendered content so that newValue
becomes the top-left visible point of the canvas.
Returns the current CanvasSize as the extent that determines the scrollbars' range.
Builds the horizontal and vertical scrollbar range/step parameters from the given viewport and canvas sizes; both minimums are 0 and the small change is always 1 pixel.
Marks the cached canvas extent invalid so it is calculated on first access.
protected override void InitializeFields()
Overrides:
Marks the cached CanvasSize as stale so it is recalculated the next time it is requested.
public void InvalidateViewport()
Implements:
Invalidates the cached canvas extent when the child collection changes.
protected override void OnChildrenChanged(RadElement child, ItemsChangeOperation changeOperation)
The child element affected by the change.
changeOperationItemsChangeOperationThe kind of change applied to the child collection.
Overrides:
Clamps the given scroll position so both axes stay within [0, extent - viewport], preventing the viewport from scrolling past the bounds of the canvas.
Computes the minimum scroll offset, relative to currentScrollValue, required to bring
childElement fully within the visible client area, accounting for its margin.
public virtual Size ScrollOffsetForChildVisible(RadElement childElement, Point currentScrollValue)
The child element that should become visible.
currentScrollValuePointThe current scroll position, used to account for the existing offset.
Returns:Implements: