Displays data items through provider-created elements and virtualizes their measurement and arrangement as they scroll into view.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Type Parameters:
Item
The reference type of the data items displayed by the panel.
Element
The visual element type used to represent each item; it must implement IVirtualizedElement<Item> and provide a parameterless constructor.
Syntax:
public class VirtualizedScrollPanel<Item, Element> : ScrollViewElement<VirtualizedStackContainer<Item>>, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IBindableComponent, IComponent, IDisposable, ISupportDrag, ISupportDrop, IShortcutProvider, IStylableElement, IStylableNode, IPrimitiveElement, IShapedElement, IFillElement, IBorderElement, IBoxStyle, IBoxElement, IDrawFillElement, IImageElement, ITextPrimitive, ITextProvider where Item : class where Element : IVirtualizedElement<Item>, new()
Inheritance: objectDisposableObjectRadObjectRadElementVisualElementRadComponentElementRadItemUIItemBaseLightVisualElementScrollViewElement<VirtualizedStackContainer<Item>>VirtualizedScrollPanel<Item, Element>...
Derived Classes:
Implements:
Inherited Members
Constructors
public VirtualizedScrollPanel()
Properties
Gets or sets a value indicating whether items auto sizing.
public bool AutoSizeItems { get; set; }
true if [auto size items]; otherwise, false.
Gets or sets a value indicating whether items fit to size.
public virtual bool FitItemsToSize { get; set; }
true if [fit items to size]; otherwise, false.
Items
IList<Item>
Gets or sets the items.
public virtual IList<Item> Items { get; set; }
The items.
Gets or sets the item spacing.
public virtual int ItemSpacing { get; set; }
The item spacing.
Gets or sets the items orientation.
public virtual Orientation Orientation { get; set; }
The orientation.
Scroller
ItemScroller<Item>
Gets the associated scroller.
public ItemScroller<Item> Scroller { get; }
The scroller.
Methods
Creates the element provider and scroller, initializes the child view, and wires the scroll events.
protected override void CreateChildElements()
Overrides:
Creates the provider used to create or reuse item elements before child elements are created.
protected virtual IVirtualizedElementProvider<Item> CreateElementProvider()
IVirtualizedElementProvider<Item>
A provider that creates elements of type Element for the panel's items.
Creates an instance of ItemScroller. Child elements are not yet created in this method.
Creates the traverser used to enumerate the supplied data items for the scroller.
protected virtual ITraverser<Item> CreateItemTraverser(IList<Item> items)
The data items to traverse.
Returns:ITraverser<Item>
A traverser over items; the default implementation uses ItemsTraverser<T>.
Unsubscribes the panel's event handlers and disposes its scroller after releasing base resources.
protected override void DisposeManagedResources()
Overrides:
Gets the element currently realized for the specified item.
public Element GetElement(Item item)
The item whose realized element is requested.
Returns:Element
The matching realized element, or the default value of Element if no child currently represents the item.
Gets an item's desired size by measuring it without width or height constraints.
protected virtual SizeF GetItemDesiredSize(Item item)
The item to measure.
Returns:The desired size reported by MeasureItem(Item, SizeF).
Connects the scroller to the panel's vertical scrollbar and element provider, then subscribes to scroller updates.
protected virtual void InitializeItemScroller(ItemScroller<Item> scroller)
The scroller to initialize.
Derived implementations must call the base method to preserve these connections.
Assigns the element and data providers to the virtualized stack container after base initialization.
protected override void InitializeViewElement(VirtualizedStackContainer<Item> viewElement)
The virtualized stack container to initialize.
Overrides:
Measures an item using a provider-created element without leaving that element among the panel's realized children.
Measures the virtualized contents and repeats the base measurement when scrollbar visibility changes the viewport.
Called when auto size is changed.
protected virtual void OnAutoSizeChanged()
Performs events unsubscription from internal objects. The base implementation must always be called.
protected virtual void UnwireEvents()
Updates the items fit to size mode.
protected virtual void UpdateFitToSizeMode()
Updates scrollbar visibility and scroller viewport size after measuring the available area.
Performs events subscription to internal objects. The base implementation must always be called.
protected virtual void WireEvents()