Class VirtualizingPanelBase
Base abstract class for creating virtualized panels.
Based on https://github.com/sbaeumlisberger/VirtualizingWrapPanel.
public abstract class VirtualizingPanelBase : VirtualizingPanel, IAnimatable, IFrameworkInputElement, IInputElement, ISupportInitialize, IQueryAmbient, IAddChild, IScrollInfo
- Inheritance
-
VirtualizingPanelBase
- Implements
- Derived
- Inherited Members
Fields
MouseWheelDeltaItemProperty
Identifies the MouseWheelDeltaItem dependency property.
public static readonly DependencyProperty MouseWheelDeltaItemProperty
Field Value
MouseWheelDeltaProperty
Identifies the MouseWheelDelta dependency property.
public static readonly DependencyProperty MouseWheelDeltaProperty
Field Value
ScrollLineDeltaItemProperty
Identifies the ScrollLineDeltaItem dependency property.
public static readonly DependencyProperty ScrollLineDeltaItemProperty
Field Value
ScrollLineDeltaProperty
Identifies the ScrollLineDelta dependency property.
public static readonly DependencyProperty ScrollLineDeltaProperty
Field Value
Properties
CacheLength
Gets the cache length before and after the viewport.
protected VirtualizationCacheLength CacheLength { get; }
Property Value
CacheLengthUnit
Gets the Unit of the cache length. Can be Pixel, Item or Page. When the ItemsOwner is a group item it can only be pixel or item.
protected VirtualizationCacheLengthUnit CacheLengthUnit { get; }
Property Value
CanHierarchicallyScrollAndVirtualizeCore
Gets a value that indicates whether the VirtualizingPanel can virtualize items that are grouped or organized in a hierarchy.
protected override bool CanHierarchicallyScrollAndVirtualizeCore { get; }
Property Value
CanHorizontallyScroll
Gets or sets a value indicating whether the content can be horizontally scrolled.
public bool CanHorizontallyScroll { get; set; }
Property Value
CanVerticallyScroll
Gets or sets a value indicating whether the content can be vertically scrolled.
public bool CanVerticallyScroll { get; set; }
Property Value
Extent
Gets the Extent.
protected Size Extent { get; }
Property Value
ExtentHeight
Gets height of the Extent.
public double ExtentHeight { get; }
Property Value
ExtentWidth
Gets width of the Extent.
public double ExtentWidth { get; }
Property Value
HorizontalOffset
Gets the horizontal offset.
public double HorizontalOffset { get; }
Property Value
IsRecycling
Gets a value indicating whether the panel is in VirtualizationMode.Recycling.
protected bool IsRecycling { get; }
Property Value
IsVirtualizing
Gets a value indicating whether the virtualizing is enabled.
protected bool IsVirtualizing { get; }
Property Value
ItemContainerGenerator
Gets items container.
protected IRecyclingItemContainerGenerator ItemContainerGenerator { get; }
Property Value
ItemRange
Gets or sets the range of items that a realized in Viewport or cache.
protected ItemRange ItemRange { get; set; }
Property Value
Items
Gets items collection.
protected ReadOnlyCollection<object> Items { get; }
Property Value
ItemsControl
Gets the ItemsControl (e.g. ListView).
protected ItemsControl ItemsControl { get; }
Property Value
ItemsOwner
Gets the ItemsControl (e.g. ListView) or if the ItemsControl is grouping a GroupItem.
protected DependencyObject ItemsOwner { get; }
Property Value
MouseWheelDelta
Gets or sets the mouse wheel delta for pixel based scrolling. The default value is 48 dp.
public double MouseWheelDelta { get; set; }
Property Value
MouseWheelDeltaItem
Gets or sets the mouse wheel delta for item based scrolling. The default value is 3 items.
public int MouseWheelDeltaItem { get; set; }
Property Value
MouseWheelScrollDirection
Gets or sets the direction in which the panel scrolls when user turns the mouse wheel.
protected ScrollDirection MouseWheelScrollDirection { get; set; }
Property Value
Offset
Gets the offset.
protected Point Offset { get; }
Property Value
ScrollLineDelta
Gets or sets the scroll line delta for pixel based scrolling. The default value is 16 dp.
public double ScrollLineDelta { get; set; }
Property Value
ScrollLineDeltaItem
Gets or sets the scroll line delta for item based scrolling. The default value is 1 item.
public int ScrollLineDeltaItem { get; set; }
Property Value
ScrollOwner
Gets or sets the scroll owner.
public ScrollViewer? ScrollOwner { get; set; }
Property Value
ScrollUnit
Gets the scroll unit.
protected ScrollUnit ScrollUnit { get; }
Property Value
VerticalOffset
Gets the vertical offset.
public double VerticalOffset { get; }
Property Value
Viewport
Gets the viewport.
protected Size Viewport { get; }
Property Value
ViewportHeight
Gets the Viewport height.
public double ViewportHeight { get; }
Property Value
ViewportWidth
Gets the Viewport width.
public double ViewportWidth { get; }
Property Value
VirtualizationMode
Gets the virtualization mode.
protected VirtualizationMode VirtualizationMode { get; }
Property Value
Methods
CalculateExtent(Size)
Calculates the extent that would be needed to show all items.
protected abstract Size CalculateExtent(Size availableSize)
Parameters
availableSize
Size
Returns
GetGeneratorPositionFromChildIndex(int)
Gets the position of children from the generator.
protected virtual GeneratorPosition GetGeneratorPositionFromChildIndex(int childIndex)
Parameters
childIndex
int
Returns
GetItemIndexFromChildIndex(int)
Gets item index from the generator.
protected int GetItemIndexFromChildIndex(int childIndex)
Parameters
childIndex
int
Returns
GetLineDownScrollAmount()
Gets line down scroll amount.
protected abstract double GetLineDownScrollAmount()
Returns
GetLineLeftScrollAmount()
Gets line left scroll amount.
protected abstract double GetLineLeftScrollAmount()
Returns
GetLineRightScrollAmount()
Gets line right scroll amount.
protected abstract double GetLineRightScrollAmount()
Returns
GetLineUpScrollAmount()
Gets line up scroll amount.
protected abstract double GetLineUpScrollAmount()
Returns
GetMouseWheelDownScrollAmount()
Gets mouse wheel down scroll amount.
protected abstract double GetMouseWheelDownScrollAmount()
Returns
GetMouseWheelLeftScrollAmount()
Gets mouse wheel left scroll amount.
protected abstract double GetMouseWheelLeftScrollAmount()
Returns
GetMouseWheelRightScrollAmount()
Gets mouse wheel right scroll amount.
protected abstract double GetMouseWheelRightScrollAmount()
Returns
GetMouseWheelUpScrollAmount()
Gets mouse wheel up scroll amount.
protected abstract double GetMouseWheelUpScrollAmount()
Returns
GetPageDownScrollAmount()
Gets page down scroll amount.
protected abstract double GetPageDownScrollAmount()
Returns
GetPageLeftScrollAmount()
Gets page left scroll amount.
protected abstract double GetPageLeftScrollAmount()
Returns
GetPageRightScrollAmount()
Gets page right scroll amount.
protected abstract double GetPageRightScrollAmount()
Returns
GetPageUpScrollAmount()
Gets page up scroll amount.
protected abstract double GetPageUpScrollAmount()
Returns
LineDown()
Scrolls down within content by one logical unit.
public void LineDown()
LineLeft()
Scrolls left within content by one logical unit.
public void LineLeft()
LineRight()
Scrolls right within content by one logical unit.
public void LineRight()
LineUp()
Scrolls up within content by one logical unit.
public void LineUp()
MakeVisible(Visual, Rect)
Forces content to scroll until the coordinate space of a Visual object is visible.
public virtual Rect MakeVisible(Visual visual, Rect rectangle)
Parameters
visual
VisualA Visual that becomes visible.
rectangle
RectA bounding rectangle that identifies the coordinate space to make visible.
Returns
MeasureOverride(Size)
When overridden in a derived class, measures the size in layout required for child elements and determines a size for the FrameworkElement-derived class.
protected override Size MeasureOverride(Size availableSize)
Parameters
availableSize
SizeThe available size that this element can give to child elements. Infinity can be specified as a value to indicate that the element will size to whatever content is available.
Returns
- Size
The size that this element determines it needs during layout, based on its calculations of child element sizes.
MouseWheelDown()
Scrolls down within content after a user clicks the wheel button on a mouse.
public void MouseWheelDown()
MouseWheelLeft()
Scrolls left within content after a user clicks the wheel button on a mouse.
public void MouseWheelLeft()
MouseWheelRight()
Scrolls right within content after a user clicks the wheel button on a mouse.
public void MouseWheelRight()
MouseWheelUp()
Scrolls up within content after a user clicks the wheel button on a mouse.
public void MouseWheelUp()
OnItemsChanged(object, ItemsChangedEventArgs)
Called when the Items collection that is associated with the ItemsControl for this Panel changes.
protected override void OnItemsChanged(object sender, ItemsChangedEventArgs args)
Parameters
sender
objectThe object that raised the event.
args
ItemsChangedEventArgsProvides data for the ItemsChanged event.
PageDown()
Scrolls down within content by one page.
public void PageDown()
PageLeft()
Scrolls left within content by one page.
public void PageLeft()
PageRight()
Scrolls right within content by one page.
public void PageRight()
PageUp()
Scrolls up within content by one page.
public void PageUp()
RealizeItems()
Realizes visible and cached items.
protected virtual void RealizeItems()
ScrollHorizontal(double)
Sets horizontal scroll offset by given amount.
protected void ScrollHorizontal(double amount)
Parameters
amount
doubleThe value by which the offset is to be increased.
ScrollVertical(double)
Sets vertical scroll offset by given amount.
protected void ScrollVertical(double amount)
Parameters
amount
doubleThe value by which the offset is to be increased.
SetHorizontalOffset(double)
Sets the horizontal offset.
public void SetHorizontalOffset(double offset)
Parameters
offset
double
SetVerticalOffset(double)
Sets the vertical offset.
public void SetVerticalOffset(double offset)
Parameters
offset
double
UpdateItemRange()
Calculates the item range that is visible in the viewport or cached.
protected abstract ItemRange UpdateItemRange()
Returns
UpdateScrollInfo(Size, Size)
Updates scroll offset, extent and viewport.
protected virtual void UpdateScrollInfo(Size availableSize, Size extent)
Parameters
VirtualizeItems()
Virtualizes (cleanups) no longer visible or cached items.
protected virtual void VirtualizeItems()