Class VirtualizingCarouselPanel
A panel used by Carousel to display the current item.
public class VirtualizingCarouselPanel : VirtualizingPanel, INotifyPropertyChanged, IDataContextProvider, ILogical, IThemeVariantHost, IResourceHost, IResourceNode, IStyleHost, ISetLogicalParent, ISetInheritanceParent, ISupportInitialize, IStyleable, INamed, IInputElement, IDataTemplateHost, ISetterValue, IChildIndexProvider, INavigableContainer, ILogicalScrollable, IScrollable
- Inheritance
-
VirtualizingCarouselPanel
- Implements
- Inherited Members
- Extension Methods
Constructors
VirtualizingCarouselPanel()
public VirtualizingCarouselPanel()
Methods
ArrangeOverride(Size)
Positions child elements as part of a layout pass.
protected override Size ArrangeOverride(Size finalSize)
Parameters
finalSize
SizeThe size available to the control.
Returns
- Size
The actual size used.
ContainerFromIndex(int)
Returns the container for the item at the specified index.
protected override Control? ContainerFromIndex(int index)
Parameters
index
intThe index of the item to retrieve.
Returns
- Control
The container for the item at the specified index within the item collection, if the item is realized; otherwise, null.
Remarks
Note for implementors: if the item at the specified index is an ItemIsOwnContainer item that has previously been realized, then the item should be returned even if it currently falls outside the realized viewport.
GetControl(NavigationDirection, IInputElement?, bool)
Gets the next control in the specified direction.
protected override IInputElement? GetControl(NavigationDirection direction, IInputElement? from, bool wrap)
Parameters
direction
NavigationDirectionThe movement direction.
from
IInputElementThe control from which movement begins.
wrap
boolWhether to wrap around when the first or last item is reached.
Returns
- IInputElement
The control.
GetRealizedContainers()
Gets the currently realized containers.
protected override IEnumerable<Control>? GetRealizedContainers()
Returns
IndexFromContainer(Control)
Returns the index to the item that has the specified realized container.
protected override int IndexFromContainer(Control container)
Parameters
container
ControlThe generated container to retrieve the item index for.
Returns
- int
The index to the item that corresponds to the specified realized container, or -1 if
container
is not found.
MeasureOverride(Size)
Measures the control and its child elements as part of a layout pass.
protected override Size MeasureOverride(Size availableSize)
Parameters
availableSize
SizeThe size available to the control.
Returns
- Size
The desired size for the control.
OnItemsChanged(IReadOnlyList<object?>, NotifyCollectionChangedEventArgs)
Called when the Items collection of the owner ItemsControl changes.
protected override void OnItemsChanged(IReadOnlyList<object?> items, NotifyCollectionChangedEventArgs e)
Parameters
items
IReadOnlyList<object>The items.
e
NotifyCollectionChangedEventArgsThe event args.
Remarks
This method is called a INotifyCollectionChanged event is raised by the items, or when the Items property is assigned a new collection, in which case the NotifyCollectionChangedAction will be Reset.
ScrollIntoView(int)
Scrolls the specified item into view.
protected override Control? ScrollIntoView(int index)
Parameters
index
intThe index of the item.
Returns
- Control
The element with the specified index, or null if the element could not be brought into view.