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
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.
Initializes member fields to their default values. This method is called prior the CreateChildItems one and allows for initialization of members on which child elements depend.
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:
protected override void OnChildrenChanged(RadElement child, ItemsChangeOperation changeOperation)
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: