### UIElement Animation Methods
Source: https://github.com/sbaeumlisberger/virtualizingwrappanel/blob/master/docs/api/WpfToolkit.Controls.VirtualizingWrapPanelWithItemExpansion.html
Methods for applying animation clocks and starting animations on UIElement dependency properties.
```APIDOC
## ApplyAnimationClock
### Description
Applies an animation clock to a specified dependency property.
### Method
Method
### Parameters
#### Request Body
- **dp** (DependencyProperty) - Required - The dependency property to animate.
- **clock** (AnimationClock) - Required - The animation clock to apply.
## ApplyAnimationClock (with HandoffBehavior)
### Description
Applies an animation clock to a specified dependency property with a defined handoff behavior.
### Method
Method
### Parameters
#### Request Body
- **dp** (DependencyProperty) - Required - The dependency property to animate.
- **clock** (AnimationClock) - Required - The animation clock to apply.
- **handoffBehavior** (HandoffBehavior) - Required - The handoff behavior to use.
## BeginAnimation
### Description
Starts an animation for a specified dependency property.
### Method
Method
### Parameters
#### Request Body
- **dp** (DependencyProperty) - Required - The dependency property to animate.
- **animation** (AnimationTimeline) - Required - The animation timeline to apply.
```
--------------------------------
### Implement Grouped Data with VirtualizingWrapPanel
Source: https://context7.com/sbaeumlisberger/virtualizingwrappanel/llms.txt
Use CollectionViewSource to group items and enable IsVirtualizingWhenGrouping for hierarchical virtualization. This setup is for a ListView with a VirtualizingWrapPanel.
```xml
```
--------------------------------
### StretchItems Property
Source: https://github.com/sbaeumlisberger/virtualizingwrappanel/blob/master/docs/api/WpfToolkit.Controls.VirtualizingWrapPanel.html
Gets or sets a value that specifies if the items get stretched to fill up remaining space. The default value is false.
```APIDOC
## StretchItems Property
### Description
Gets or sets a value that specifies if the items get stretched to fill up remaining space. The default value is false.
### Property Value
[bool](https://learn.microsoft.com/dotnet/api/system.boolean)
### Remarks
The MaxWidth and MaxHeight properties of the ItemContainerStyle can be used to limit the stretching. In this case the use of the remaining space will be determined by the SpacingMode property.
```
--------------------------------
### Apply Theme Configuration
Source: https://github.com/sbaeumlisberger/virtualizingwrappanel/blob/master/docs/api/WpfToolkit.Controls.VirtualizingItemsControl.html
Sets the document theme based on local storage or system preference.
```javascript
const theme = localStorage.getItem('theme') || 'auto' document.documentElement.setAttribute('data-bs-theme', theme === 'auto' ? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light') : theme)
```
--------------------------------
### Theme Initialization Script
Source: https://github.com/sbaeumlisberger/virtualizingwrappanel/blob/master/docs/api/index.html
Initializes the theme based on local storage or user preference. Sets the 'data-bs-theme' attribute on the document element.
```javascript
const theme = localStorage.getItem('theme') || 'auto'
document.documentElement.setAttribute('data-bs-theme', theme === 'auto' ? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light') : theme)
```
--------------------------------
### SpacingMode Property
Source: https://github.com/sbaeumlisberger/virtualizingwrappanel/blob/master/docs/api/WpfToolkit.Controls.VirtualizingWrapPanel.html
Gets or sets the spacing mode used when arranging the items. The default value is Uniform.
```APIDOC
## SpacingMode Property
### Description
Gets or sets the spacing mode used when arranging the items. The default value is [Uniform](WpfToolkit.Controls.SpacingMode.html#WpfToolkit_Controls_SpacingMode_Uniform).
### Property Value
[SpacingMode](WpfToolkit.Controls.SpacingMode.html)
```
--------------------------------
### DependencyObject Methods
Source: https://github.com/sbaeumlisberger/virtualizingwrappanel/blob/master/docs/api/WpfToolkit.Controls.VirtualizingWrapPanelWithItemExpansion.html
Methods for managing dependency properties, including getting, setting, coercing, and invalidating values.
```APIDOC
## DependencyObject Methods
### Description
Methods inherited from DependencyObject for managing dependency properties.
### Methods
- **Equals(object obj)** - Determines whether the specified object is equal to the current object.
- **GetHashCode()** - Serves as the default hash function.
- **GetValue(DependencyProperty dp)** - Gets the value of the specified dependency property.
- **SetValue(DependencyProperty dp, object value)** - Sets the value of the specified dependency property.
- **SetCurrentValue(DependencyProperty dp, object value)** - Sets the current value of a dependency property on this instance.
- **SetValue(DependencyPropertyKey key, object value)** - Sets the value of the specified dependency property using a DependencyPropertyKey.
- **ClearValue(DependencyProperty dp)** - Clears the locally set value of the specified dependency property.
- **ClearValue(DependencyPropertyKey key)** - Clears the locally set value of the specified dependency property using a DependencyPropertyKey.
- **CoerceValue(DependencyProperty dp)** - Coerces the value of the specified dependency property.
- **InvalidateProperty(DependencyProperty dp)** - Invalidates the specified dependency property.
- **ShouldSerializeProperty(DependencyProperty dp)** - Indicates whether the property should be serialized.
- **ReadLocalValue(DependencyProperty dp)** - Returns the local value of a dependency property.
- **GetLocalValueEnumerator()** - Returns an enumerator for the local values.
- **DependencyObjectType** (DependencyObjectType) - Gets the DependencyObjectType for the current instance.
- **IsSealed** (bool) - Gets a value that indicates whether this instance is sealed.
```
--------------------------------
### Add VirtualizingWrapPanel Package
Source: https://github.com/sbaeumlisberger/virtualizingwrappanel/blob/master/src/VirtualizingWrapPanel/docfx/docs/getting-started.md
Use the .NET CLI to add the VirtualizingWrapPanel package to your project.
```bash
dotnet add package VirtualizingWrapPanel
```
--------------------------------
### ViewportWidth Property
Source: https://github.com/sbaeumlisberger/virtualizingwrappanel/blob/master/docs/api/WpfToolkit.Controls.VirtualizingPanelBase.html
Gets the horizontal size of the viewport for the content in device-independent pixels. This property has no default value.
```APIDOC
## ViewportWidth
### Description
Gets the horizontal size of the viewport for this content. This property has no default value.
### Property
`public double ViewportWidth { get; }`
### Type
[double](https://learn.microsoft.com/dotnet/api/system.double)
```
--------------------------------
### Initialization and Lifecycle
Source: https://github.com/sbaeumlisberger/virtualizingwrappanel/blob/master/docs/api/WpfToolkit.Controls.VirtualizingWrapPanelWithItemExpansion.html
Methods related to the initialization and lifecycle of a FrameworkElement.
```APIDOC
## FrameworkElement.BeginInit
### Description
Begins the initialization process for the element.
### Method
`BeginInit`
### Endpoint
N/A (Method call)
### Parameters
None
### Request Example
```csharp
// Example usage (conceptual)
myFrameworkElement.BeginInit();
```
### Response
None
## FrameworkElement.EndInit
### Description
Ends the initialization process for the element.
### Method
`EndInit`
### Endpoint
N/A (Method call)
### Parameters
None
### Request Example
```csharp
// Example usage (conceptual)
myFrameworkElement.EndInit();
```
### Response
None
## FrameworkElement.OnInitialized
### Description
Called when the element is initialized.
### Method
`OnInitialized`
### Endpoint
N/A (Method call)
### Parameters
#### Path Parameters
None
#### Query Parameters
None
#### Request Body
None
### Request Example
```csharp
// Example usage (conceptual)
EventArgs args = new EventArgs();
myFrameworkElement.OnInitialized(args);
```
### Response
None
```
--------------------------------
### Constructor: GridDetailsView
Source: https://github.com/sbaeumlisberger/virtualizingwrappanel/blob/master/docs/api/WpfToolkit.Controls.GridDetailsView.html
Initializes a new instance of the GridDetailsView class.
```APIDOC
## Constructor GridDetailsView
### Description
Initializes a new instance of the GridDetailsView class.
### Method
public GridDetailsView()
```
--------------------------------
### ViewportHeight Property
Source: https://github.com/sbaeumlisberger/virtualizingwrappanel/blob/master/docs/api/WpfToolkit.Controls.VirtualizingPanelBase.html
Gets the vertical size of the viewport for the content in device-independent pixels. This property has no default value.
```APIDOC
## ViewportHeight
### Description
Gets the vertical size of the viewport for this content. This property has no default value.
### Property
`public double ViewportHeight { get; }`
### Type
[double](https://learn.microsoft.com/dotnet/api/system.double)
```
--------------------------------
### Implement MainViewModel for VirtualizingWrapPanel
Source: https://context7.com/sbaeumlisberger/virtualizingwrappanel/llms.txt
A complete ViewModel implementation using INotifyPropertyChanged and ObservableCollection to manage VirtualizingWrapPanel settings and data items.
```csharp
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Windows;
using System.Windows.Controls;
using WpfToolkit.Controls;
public class MainViewModel : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
private Orientation _orientation = Orientation.Horizontal;
private SpacingMode _spacingMode = SpacingMode.Uniform;
private bool _stretchItems = false;
private Size _itemSize = Size.Empty;
public ObservableCollection Items { get; } = new();
public Orientation Orientation
{
get => _orientation;
set { _orientation = value; OnPropertyChanged(); }
}
public SpacingMode SpacingMode
{
get => _spacingMode;
set { _spacingMode = value; OnPropertyChanged(); }
}
public bool StretchItems
{
get => _stretchItems;
set { _stretchItems = value; OnPropertyChanged(); }
}
public Size ItemSize
{
get => _itemSize;
set { _itemSize = value; OnPropertyChanged(); }
}
public MainViewModel()
{
// Add sample items
for (int i = 0; i < 10000; i++)
{
Items.Add(new ItemModel
{
Id = i,
Name = $"Item {i}",
Category = $"Group {i / 100}"
});
}
}
protected void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
public class ItemModel
{
public int Id { get; set; }
public string Name { get; set; }
public string Category { get; set; }
}
```
--------------------------------
### ScrollOwner Property
Source: https://github.com/sbaeumlisberger/virtualizingwrappanel/blob/master/docs/api/WpfToolkit.Controls.VirtualizingPanelBase.html
Gets or sets the ScrollViewer element that controls scrolling behavior. This property has no default value.
```APIDOC
## ScrollOwner
### Description
Gets or sets a [ScrollViewer](https://learn.microsoft.com/dotnet/api/system.windows.controls.scrollviewer) element that controls scrolling behavior. This property has no default value.
### Property
`public ScrollViewer? ScrollOwner { get; set; }`
### Type
[ScrollViewer](https://learn.microsoft.com/dotnet/api/system.windows.controls.scrollviewer)
```
--------------------------------
### Initialize GridView
Source: https://github.com/sbaeumlisberger/virtualizingwrappanel/blob/master/docs/api/WpfToolkit.Controls.GridView.html
Constructor for the GridView class.
```csharp
public GridView()
```
--------------------------------
### FrameworkElement Methods
Source: https://github.com/sbaeumlisberger/virtualizingwrappanel/blob/master/docs/api/WpfToolkit.Controls.VirtualizingPanelBase.html
Documentation for key methods of the FrameworkElement class.
```APIDOC
## FrameworkElement Methods
### PredictFocus
#### Description
Predicts the focus behavior in a given direction.
### OnGotFocus
#### Description
Provides a way to handle the GotFocus event.
### BeginInit
#### Description
Begins the initialization process for the element.
### EndInit
#### Description
Ends the initialization process for the element.
### OnInitialized
#### Description
Provides a way to handle the Initialized event.
### OnToolTipOpening
#### Description
Provides a way to handle the ToolTipOpening event.
### OnToolTipClosing
#### Description
Provides a way to handle the ToolTipClosing event.
### OnContextMenuOpening
#### Description
Provides a way to handle the ContextMenuOpening event.
### OnContextMenuClosing
#### Description
Provides a way to handle the ContextMenuClosing event.
### RegisterName
#### Description
Registers a name for the element.
### UnregisterName
#### Description
Unregisters a name from the element.
### FindName
#### Description
Finds an element by its registered name.
### UpdateDefaultStyle
#### Description
Updates the default style for the element.
```
--------------------------------
### Orientation Property
Source: https://github.com/sbaeumlisberger/virtualizingwrappanel/blob/master/docs/api/WpfToolkit.Controls.VirtualizingWrapPanel.html
Gets or sets a value that specifies the orientation in which items are arranged before wrapping. The default value is Horizontal.
```APIDOC
## Orientation Property
### Description
Gets or sets a value that specifies the orientation in which items are arranged before wrapping. The default value is [Horizontal](https://learn.microsoft.com/dotnet/api/system.windows.controls.orientation#system-windows-controls-orientation-horizontal).
### Property Value
[Orientation](https://learn.microsoft.com/dotnet/api/system.windows.controls.orientation)
```
--------------------------------
### VirtualizingPanelBase Methods
Source: https://github.com/sbaeumlisberger/virtualizingwrappanel/blob/master/docs/api/WpfToolkit.Controls.VirtualizingWrapPanelWithItemExpansion.html
This section details the methods available in the VirtualizingPanelBase class for managing virtualization, scrolling, and item visibility.
```APIDOC
## VirtualizingPanelBase Methods
### Description
Methods for controlling virtualization behavior, scrolling, and ensuring items are visible.
### Methods
- **ShouldIgnoreMeasure()** - Determines if the measure pass should be ignored.
- **VerifyItemsControl()** - Verifies that the associated ItemsControl is valid.
- **MakeVisible(Visual, Rect)** - Makes the specified visual element visible within the viewport.
- **Parameters**
- **visual** (Visual) - The visual element to make visible.
- **clipRect** (Rect) - The clipping rectangle.
- **SetVerticalOffset(double)** - Sets the vertical scroll offset.
- **Parameters**
- **offset** (double) - The new vertical offset.
- **SetHorizontalOffset(double)** - Sets the horizontal scroll offset.
- **Parameters**
- **offset** (double) - The new horizontal offset.
- **LineUp()** - Scrolls the content up by one line.
- **LineDown()** - Scrolls the content down by one line.
- **LineLeft()** - Scrolls the content left by one line.
- **LineRight()** - Scrolls the content right by one line.
- **MouseWheelUp()** - Handles mouse wheel scrolling up.
- **MouseWheelDown()** - Handles mouse wheel scrolling down.
- **MouseWheelLeft()** - Handles mouse wheel scrolling left.
- **MouseWheelRight()** - Handles mouse wheel scrolling right.
- **PageUp()** - Scrolls the content up by one page.
- **PageDown()** - Scrolls the content down by one page.
- **PageLeft()** - Scrolls the content left by one page.
- **PageRight()** - Scrolls the content right by one page.
```
--------------------------------
### VerticalOffset Property
Source: https://github.com/sbaeumlisberger/virtualizingwrappanel/blob/master/docs/api/WpfToolkit.Controls.VirtualizingPanelBase.html
Gets the vertical offset of the scrolled content in device-independent pixels. Valid values are between zero and the ExtentHeight minus the ViewportHeight.
```APIDOC
## VerticalOffset
### Description
Gets the vertical offset of the scrolled content. Valid values are between zero and the [ExtentHeight](https://learn.microsoft.com/dotnet/api/system.windows.controls.primitives.iscrollinfo.extentheight) minus the [ViewportHeight](https://learn.microsoft.com/dotnet/api/system.windows.controls.primitives.iscrollinfo.viewportheight).
### Property
`public double VerticalOffset { get; }`
### Type
[double](https://learn.microsoft.com/dotnet/api/system.double)
```
--------------------------------
### Constructor: VirtualizingItemsControl()
Source: https://github.com/sbaeumlisberger/virtualizingwrappanel/blob/master/docs/api/WpfToolkit.Controls.VirtualizingItemsControl.html
Initializes a new instance of the VirtualizingItemsControl class.
```APIDOC
## Constructor: VirtualizingItemsControl()
### Description
Initializes a new instance of the VirtualizingItemsControl class.
### Method
Constructor
### Request Example
var control = new VirtualizingItemsControl();
```
--------------------------------
### Implement IItemSizeProvider for Custom Item Sizing
Source: https://context7.com/sbaeumlisberger/virtualizingwrappanel/llms.txt
Implement the IItemSizeProvider interface to dynamically provide sizes for items, ensuring correct layout during fast scrolling when AllowDifferentSizedItems is enabled.
```csharp
using System.Windows;
using WpfToolkit.Controls;
public class ImageItemSizeProvider : IItemSizeProvider
{
public Size GetSizeForItem(object item)
{
if (item is ImageItem imageItem)
{
// Return the known size for this item
return new Size(imageItem.Width, imageItem.Height);
}
// Return a fallback size for unknown items
return new Size(100, 100);
}
}
public class ImageItem
{
public string Name { get; set; }
public double Width { get; set; }
public double Height { get; set; }
public string ImagePath { get; set; }
}
// ViewModel usage
public class MainViewModel
{
public IItemSizeProvider ItemSizeProvider { get; } = new ImageItemSizeProvider();
public ObservableCollection Items { get; } = new();
}
```
--------------------------------
### ItemSize Property
Source: https://github.com/sbaeumlisberger/virtualizingwrappanel/blob/master/docs/api/WpfToolkit.Controls.VirtualizingWrapPanel.html
Gets or sets a value that specifies the size of the items. If the value is Empty, the item size is determined by measuring the first realized item.
```APIDOC
## ItemSize Property
### Description
Gets or sets a value that specifies the size of the items. The default value is [Empty](https://learn.microsoft.com/dotnet/api/system.windows.size.empty). If the value is [Empty](https://learn.microsoft.com/dotnet/api/system.windows.size.empty) the item size is determined by measuring the first realized item.
### Property Value
[Size](https://learn.microsoft.com/dotnet/api/system.windows.size)
```
--------------------------------
### VirtualizationMode Property
Source: https://github.com/sbaeumlisberger/virtualizingwrappanel/blob/master/docs/api/WpfToolkit.Controls.VirtualizingPanelBase.html
Indicates the current virtualization mode.
```APIDOC
## VirtualizationMode
### Description
Indicates the current virtualization mode.
### Property
`protected VirtualizationMode VirtualizationMode { get; }`
### Type
[VirtualizationMode](https://learn.microsoft.com/dotnet/api/system.windows.controls.virtualizationmode)
```
--------------------------------
### FrameworkElement Methods
Source: https://github.com/sbaeumlisberger/virtualizingwrappanel/blob/master/docs/api/WpfToolkit.Controls.VirtualizingItemsControl.html
Methods for managing templates, resources, and visual elements.
```APIDOC
## FrameworkElement Methods
### ApplyTemplate
- **Description**: Builds the visual tree for the current template.
### OnApplyTemplate
- **Description**: Invoked whenever application code or internal processes call ApplyTemplate.
### FindResource
- **Parameters**: object resourceKey
- **Description**: Searches for a resource with the specified key.
### TryFindResource
- **Parameters**: object resourceKey
- **Description**: Searches for a resource with the specified key, returning null if not found.
### GetTemplateChild
- **Parameters**: string childName
- **Description**: Returns the named element in the visual tree of the instantiated ControlTemplate.
```
--------------------------------
### Configure VirtualizationMode
Source: https://context7.com/sbaeumlisberger/virtualizingwrappanel/llms.txt
Enable container recycling to improve performance when handling large item collections.
```xml
```
--------------------------------
### GridView Constructor
Source: https://github.com/sbaeumlisberger/virtualizingwrappanel/blob/master/docs/api/WpfToolkit.Controls.GridView.html
Initializes a new instance of the GridView class.
```APIDOC
## GridView()
### Description
Initializes a new instance of the GridView class.
### Method
Constructor
### Endpoint
N/A
### Parameters
None
### Request Example
None
### Response
None
### Response Example
None
```
--------------------------------
### UIElement Layout and Rendering
Source: https://github.com/sbaeumlisberger/virtualizingwrappanel/blob/master/docs/api/WpfToolkit.Controls.VirtualizingWrapPanel.html
Methods for managing layout, rendering, and hit testing for UI elements.
```APIDOC
## UIElement Layout and Rendering
### Description
Provides methods for invalidating layout, arranging elements, and performing hit tests.
### Methods
- **InvalidateMeasure()**: Invalidates the measurement for the element, forcing a re-layout.
- **InvalidateArrange()**: Invalidates the arrange pass for the element, forcing a re-arrangement.
- **InvalidateVisual()**: Invalidates the visual representation of the element, forcing a repaint.
- **OnChildDesiredSizeChanged(UIElement)**: Called when a child element's desired size changes.
- **Measure(Size)**: Measures the desired size of the element.
- **Arrange(Rect)**: Arranges the element within the specified rectangle.
- **UpdateLayout()**: Forces the element and its children to update their layout.
- **TranslatePoint(Point, UIElement)**: Translates a point from the coordinate system of one element to another.
- **InputHitTest(Point)**: Determines the element that is at the specified point.
- **HitTestCore(PointHitTestParameters)**: Performs a hit test using point parameters.
- **HitTestCore(GeometryHitTestParameters)**: Performs a hit test using geometry parameters.
```
--------------------------------
### Configure Caching Behavior
Source: https://github.com/sbaeumlisberger/virtualizingwrappanel/blob/master/docs/docs/getting-started.html
Set cache length and units to optimize virtualization performance.
```xml
```
```xml
```
--------------------------------
### UIElement Layout and Rendering Methods
Source: https://github.com/sbaeumlisberger/virtualizingwrappanel/blob/master/docs/api/WpfToolkit.Controls.VirtualizingWrapPanelWithItemExpansion.html
Methods for controlling layout, measurement, and rendering of a UIElement.
```APIDOC
## UIElement.InvalidateMeasure
### Description
Invalidates the measurement of the element, forcing a re-measurement.
### Method
`void InvalidateMeasure()`
### Endpoint
N/A
### Parameters
None
### Request Example
None
### Response
#### Success Response (200)
None
#### Response Example
None
## UIElement.InvalidateArrange
### Description
Invalidates the arrange pass of the element, forcing a re-arrangement.
### Method
`void InvalidateArrange()`
### Endpoint
N/A
### Parameters
None
### Request Example
None
### Response
#### Success Response (200)
None
#### Response Example
None
## UIElement.InvalidateVisual
### Description
Invalidates the visual representation of the element, forcing a re-rendering.
### Method
`void InvalidateVisual()`
### Endpoint
N/A
### Parameters
None
### Request Example
None
### Response
#### Success Response (200)
None
#### Response Example
None
## UIElement.OnChildDesiredSizeChanged
### Description
Called when the desired size of a child element changes.
### Method
Event Handler
### Endpoint
N/A
### Parameters
#### Path Parameters
None
#### Query Parameters
None
#### Request Body
- **child** (UIElement) - Required - The child element whose desired size has changed.
### Request Example
None
### Response
#### Success Response (200)
None
#### Response Example
None
## UIElement.Measure
### Description
Measures the UIElement and its children in preparation for arranging.
### Method
`void Measure(Size availableSize)`
### Endpoint
N/A
### Parameters
#### Path Parameters
None
#### Query Parameters
None
#### Request Body
- **availableSize** (Size) - Required - The available size for the element.
### Request Example
None
### Response
#### Success Response (200)
None
#### Response Example
None
## UIElement.Arrange
### Description
Arranges the UIElement and its children.
### Method
`void Arrange(Rect finalRect)`
### Endpoint
N/A
### Parameters
#### Path Parameters
None
#### Query Parameters
None
#### Request Body
- **finalRect** (Rect) - Required - The final rectangle for the element.
### Request Example
None
### Response
#### Success Response (200)
None
#### Response Example
None
## UIElement.UpdateLayout
### Description
Forces the element to update its layout.
### Method
`void UpdateLayout()`
### Endpoint
N/A
### Parameters
None
### Request Example
None
### Response
#### Success Response (200)
None
#### Response Example
None
```
--------------------------------
### Layout and Rendering Methods
Source: https://github.com/sbaeumlisberger/virtualizingwrappanel/blob/master/docs/api/WpfToolkit.Controls.GridDetailsView.html
Methods for controlling the layout and rendering of UI elements.
```APIDOC
## UIElement Layout and Rendering Methods
### Description
These methods are used to manage the layout, measurement, and rendering of UI elements.
### Methods
- `InvalidateMeasure()`
- `InvalidateArrange()`
- `InvalidateVisual()`
- `OnChildDesiredSizeChanged(UIElement)`
- `Measure(Size)`
- `Arrange(Rect)`
- `OnRender(DrawingContext)`
- `UpdateLayout()`
### Parameters
- **element** (UIElement) - The child element whose desired size has changed (for `OnChildDesiredSizeChanged`).
- **availableSize** (Size) - The available size for measurement (for `Measure`).
- **finalRect** (Rect) - The final layout rectangle for the element (for `Arrange`).
- **drawingContext** (DrawingContext) - The context for rendering (for `OnRender`).
```
--------------------------------
### FrameworkElement Layout Methods
Source: https://github.com/sbaeumlisberger/virtualizingwrappanel/blob/master/docs/api/WpfToolkit.Controls.GridView.html
Methods related to element layout, rendering, and visibility.
```APIDOC
## BringIntoView
### Description
Attempts to bring the element into view within a scrollable region.
### Parameters
#### Request Body
- **rect** (Rect) - Optional - The region to bring into view.
```
```APIDOC
## MeasureCore / ArrangeCore
### Description
Core methods for the layout pass (Measure and Arrange).
### Parameters
#### Request Body
- **availableSize/finalRect** (Size/Rect) - Required - The constraints for layout.
```
--------------------------------
### Panel Methods
Source: https://github.com/sbaeumlisberger/virtualizingwrappanel/blob/master/docs/api/WpfToolkit.Controls.VirtualizingWrapPanel.html
Methods available on the Panel class, relevant to VirtualizingWrapPanel.
```APIDOC
## Panel.OnRender
### Description
Called when the panel needs to render its content.
### Method
protected virtual void
### Endpoint
N/A (Method)
### Parameters
#### Path Parameters
None
#### Query Parameters
None
#### Request Body
None
### Request Example
None
### Response
#### Success Response (200)
None
#### Response Example
None
```
```APIDOC
## Panel.OnIsItemsHostChanged
### Description
Called when the IsItemsHost property changes.
### Method
protected virtual void
### Endpoint
N/A (Method)
### Parameters
#### Path Parameters
None
#### Query Parameters
None
#### Request Body
None
### Request Example
None
### Response
#### Success Response (200)
None
#### Response Example
None
```
```APIDOC
## Panel.GetVisualChild
### Description
Retrieves a child visual element at the specified index.
### Method
protected Visual GetVisualChild(int index)
### Endpoint
N/A (Method)
### Parameters
#### Path Parameters
None
#### Query Parameters
None
#### Request Body
None
### Request Example
None
### Response
#### Success Response (200)
Returns the Visual child element.
#### Response Example
None
```
```APIDOC
## Panel.CreateUIElementCollection
### Description
Creates a new UIElementCollection for the panel.
### Method
protected UIElementCollection CreateUIElementCollection(FrameworkElement logicalParent)
### Endpoint
N/A (Method)
### Parameters
#### Path Parameters
None
#### Query Parameters
None
#### Request Body
None
### Request Example
None
### Response
#### Success Response (200)
Returns a new UIElementCollection.
#### Response Example
None
```
```APIDOC
## Panel.OnVisualChildrenChanged
### Description
Called when the visual children of the panel change.
### Method
protected virtual void
### Endpoint
N/A (Method)
### Parameters
#### Path Parameters
None
#### Query Parameters
None
#### Request Body
None
### Request Example
None
### Response
#### Success Response (200)
None
#### Response Example
None
```
```APIDOC
## Panel.SetZIndex
### Description
Sets the Z-index of a UI element within the panel.
### Method
public static void SetZIndex(UIElement element, int index)
### Endpoint
N/A (Static Method)
### Parameters
#### Path Parameters
None
#### Query Parameters
None
#### Request Body
None
### Request Example
None
### Response
#### Success Response (200)
None
#### Response Example
None
```
```APIDOC
## Panel.GetZIndex
### Description
Gets the Z-index of a UI element within the panel.
### Method
public static int GetZIndex(UIElement element)
### Endpoint
N/A (Static Method)
### Parameters
#### Path Parameters
None
#### Query Parameters
None
#### Request Body
None
### Request Example
None
### Response
#### Success Response (200)
Returns the Z-index of the UI element.
#### Response Example
None
```
--------------------------------
### VirtualizingWrapPanel API Reference
Source: https://github.com/sbaeumlisberger/virtualizingwrappanel/wiki/Home
This section details the core components and functionalities of the VirtualizingWrapPanel.
```APIDOC
## VirtualizingWrapPanel API Reference
### Description
Provides access to the properties, methods, and events of the VirtualizingWrapPanel control.
### Endpoint
N/A (This is a class reference, not a REST API endpoint)
### Properties
#### General Properties
- **ItemsSource** (IEnumerable) - Required - The collection of items to display.
- **ItemTemplate** (DataTemplate) - Optional - The template to use for displaying each item.
- **ItemHeight** (double) - Optional - The height of each item. If not specified, it's calculated based on content.
- **ItemWidth** (double) - Optional - The width of each item. If not specified, it's calculated based on content.
- **Orientation** (Orientation) - Optional - The orientation of the panel (Horizontal or Vertical). Defaults to Horizontal.
- **ScrollOwner** (ScrollViewer) - Optional - The ScrollViewer that owns this panel. Used for virtualization.
#### Virtualization Properties
- **IsVirtualizing** (bool) - Optional - Enables or disables virtualization. Defaults to true.
- **VirtualizationMode** (VirtualizationMode) - Optional - Specifies the virtualization mode (e.g., Recycling, Standard). Defaults to Recycling.
### Methods
- **PrepareContainerForItemOverride**(DependencyObject element, Object item)
- Description: Prepares the container for a new item.
- **ClearContainerForItemOverride**(DependencyObject element, Object item)
- Description: Clears the container when an item is removed.
### Events
- **ItemsChanged** (ItemsChangedEventHandler)
- Description: Occurs when the items collection changes.
### Request Example
N/A (This is a class reference)
### Response
N/A (This is a class reference)
```
--------------------------------
### Layout and Rendering
Source: https://github.com/sbaeumlisberger/virtualizingwrappanel/blob/master/docs/api/WpfToolkit.Controls.VirtualizingWrapPanelWithItemExpansion.html
Methods and properties related to the layout and rendering of FrameworkElement.
```APIDOC
## FrameworkElement.MeasureCore
### Description
Measures the element to determine its size.
### Method
`MeasureCore`
### Endpoint
N/A (Method call)
### Parameters
#### Path Parameters
None
#### Query Parameters
None
#### Request Body
None
### Request Example
```csharp
// Example usage (conceptual)
Size desiredSize = new Size(100, 100);
myFrameworkElement.MeasureCore(desiredSize);
```
### Response
None
## FrameworkElement.ArrangeCore
### Description
Arranges the element within its parent.
### Method
`ArrangeCore`
### Endpoint
N/A (Method call)
### Parameters
#### Path Parameters
None
#### Query Parameters
None
#### Request Body
None
### Request Example
```csharp
// Example usage (conceptual)
Rect finalRect = new Rect(0, 0, 100, 100);
myFrameworkElement.ArrangeCore(finalRect);
```
### Response
None
## FrameworkElement.OnRenderSizeChanged
### Description
Called when the rendered size of the element changes.
### Method
`OnRenderSizeChanged`
### Endpoint
N/A (Method call)
### Parameters
#### Path Parameters
None
#### Query Parameters
None
#### Request Body
None
### Request Example
```csharp
// Example usage (conceptual)
SizeChangedInfo sizeInfo = new SizeChangedInfo(oldSize, newSize, widthChanged, heightChanged);
myFrameworkElement.OnRenderSizeChanged(sizeInfo);
```
### Response
None
## FrameworkElement.GetLayoutClip
### Description
Gets the layout clip for the element.
### Method
`GetLayoutClip`
### Endpoint
N/A (Method call)
### Parameters
#### Path Parameters
None
#### Query Parameters
None
#### Request Body
None
### Request Example
```csharp
// Example usage (conceptual)
Size layoutSize = new Size(100, 100);
Rect clipRect = myFrameworkElement.GetLayoutClip(layoutSize);
```
### Response
- **clipRect** (Rect) - The rectangle that defines the clipping region for the layout.
## FrameworkElement.BringIntoView
### Description
Scrolls the element into view.
### Method
`BringIntoView`
### Endpoint
N/A (Method call)
### Parameters
#### Path Parameters
None
#### Query Parameters
None
#### Request Body
None
### Request Example
```csharp
// Example usage (conceptual)
myFrameworkElement.BringIntoView();
// With a specific Rect
Rect targetRect = new Rect(10, 10, 50, 50);
myFrameworkElement.BringIntoView(targetRect);
```
### Response
None
## FrameworkElement.UseLayoutRounding
### Description
Gets or sets a value indicating whether layout rounding is enabled for the element.
### Method
Property (Get/Set)
### Endpoint
N/A (Property access)
### Parameters
None
### Request Example
```csharp
// Get UseLayoutRounding
bool useRounding = myFrameworkElement.UseLayoutRounding;
// Set UseLayoutRounding
myFrameworkElement.UseLayoutRounding = true;
```
### Response
None
```
--------------------------------
### Enable StretchItems in VirtualizingWrapPanel
Source: https://context7.com/sbaeumlisberger/virtualizingwrappanel/llms.txt
Use StretchItems="True" to make items fill available space in each row. MaxWidth/MaxHeight on item containers can limit this stretching.
```xml
```
--------------------------------
### FrameworkElement Properties
Source: https://github.com/sbaeumlisberger/virtualizingwrappanel/blob/master/docs/api/WpfToolkit.Controls.VirtualizingPanelBase.html
Documentation for key properties of the FrameworkElement class.
```APIDOC
## FrameworkElement Properties
### Style
#### Description
Gets or sets the style for the element.
### OverridesDefaultStyle
#### Description
Gets or sets a value indicating whether the element overrides the default style.
### UseLayoutRounding
#### Description
Gets or sets a value indicating whether layout rounding is used.
### DefaultStyleKey
#### Description
Gets or sets the key to use for the default style.
### Triggers
#### Description
Gets a collection of triggers for the element.
### TemplatedParent
#### Description
Gets the element that contains the templated parent.
### Resources
#### Description
Gets or sets the dictionary of resources.
### InheritanceBehavior
#### Description
Gets or sets the inheritance behavior for the element.
### DataContext
#### Description
Gets or sets the data context for data binding.
### BindingGroup
#### Description
Gets or sets the binding group for the element.
### Language
#### Description
Gets or sets the language for the element.
### Name
#### Description
Gets or sets the name of the element.
### Tag
#### Description
Gets or sets a custom object value that can be used to store arbitrary information.
### InputScope
#### Description
Gets or sets the input scope for the element.
### ActualWidth
#### Description
Gets the actual width of the element.
### ActualHeight
#### Description
Gets the actual height of the element.
### LayoutTransform
#### Description
Gets or sets the transform applied to the layout of the element.
### Width
#### Description
Gets or sets the width of the element.
### MinWidth
#### Description
Gets or sets the minimum width of the element.
### MaxWidth
#### Description
Gets or sets the maximum width of the element.
### Height
#### Description
Gets or sets the height of the element.
### MinHeight
#### Description
Gets or sets the minimum height of the element.
### MaxHeight
#### Description
Gets or sets the maximum height of the element.
### FlowDirection
#### Description
Gets or sets the flow direction of the element.
### Margin
#### Description
Gets or sets the margin for the element.
```
--------------------------------
### FrameworkElement Properties and Events
Source: https://github.com/sbaeumlisberger/virtualizingwrappanel/blob/master/docs/api/WpfToolkit.Controls.GridView.html
Documentation for properties and events related to FrameworkElement, the base class for most WPF elements.
```APIDOC
## FrameworkElement Properties and Events
### Description
This section covers properties and events inherited from FrameworkElement, which are fundamental to WPF elements.
### StyleProperty
Identifies the Style property.
### OverridesDefaultStyleProperty
Identifies the OverridesDefaultStyle property.
### UseLayoutRoundingProperty
Identifies the UseLayoutRounding property.
### DefaultStyleKeyProperty
Identifies the DefaultStyleKey property.
### DataContextProperty
Identifies the DataContext property.
### BindingGroupProperty
Identifies the BindingGroup property.
### LanguageProperty
Identifies the Language property.
### NameProperty
Identifies the Name property.
### TagProperty
Identifies the Tag property.
### InputScopeProperty
Identifies the InputScope property.
### RequestBringIntoViewEvent
Identifies the RequestBringIntoView routed event.
### SizeChangedEvent
Identifies the SizeChanged routed event.
### ActualWidthProperty
Identifies the ActualWidth property.
### ActualHeightProperty
Identifies the ActualHeight property.
### LayoutTransformProperty
Identifies the LayoutTransform property.
### WidthProperty
Identifies the Width property.
### MinWidthProperty
Identifies the MinWidth property.
```
--------------------------------
### Dependency Properties
Source: https://github.com/sbaeumlisberger/virtualizingwrappanel/blob/master/docs/api/WpfToolkit.Controls.VirtualizingWrapPanel.html
List of DependencyProperty fields available for the VirtualizingWrapPanel.
```APIDOC
## Dependency Properties
- **OrientationProperty**: DependencyProperty
- **SpacingModeProperty**: DependencyProperty
- **StretchItemsProperty**: DependencyProperty
```
--------------------------------
### Define IItemSizeProvider Interface
Source: https://github.com/sbaeumlisberger/virtualizingwrappanel/blob/master/docs/api/WpfToolkit.Controls.IItemSizeProvider.html
Defines the contract for providing item sizes within a virtualizing panel. Implement this interface to customize how item dimensions are calculated.
```csharp
public interface IItemSizeProvider
```
--------------------------------
### Configure Grouping in VirtualizingWrapPanel
Source: https://github.com/sbaeumlisberger/virtualizingwrappanel/blob/master/src/VirtualizingWrapPanel/docfx/docs/getting-started.md
Use CollectionViewSource to define group descriptions and set VirtualizingPanel.IsVirtualizingWhenGrouping to True. Ensure the GroupStyle panel uses a VirtualizingStackPanel.
```xml
```
--------------------------------
### VirtualizingWrapPanel Properties
Source: https://github.com/sbaeumlisberger/virtualizingwrappanel/blob/master/docs/api/WpfToolkit.Controls.VirtualizingWrapPanel.html
Configuration properties for controlling the layout and behavior of the VirtualizingWrapPanel.
```APIDOC
## Properties
### AllowDifferentSizedItems
- **Description**: Specifies whether items can have different sizes. Default is false. If enabled, it is recommended to set ItemSizeProvider.
- **Type**: bool
### IsGridLayoutEnabled
- **Description**: Specifies whether items are arranged in a grid-like layout. Default is true. If AllowDifferentSizedItems is enabled, this property has no effect.
- **Type**: bool
### ItemAlignment
- **Description**: Specifies how items are aligned on the cross axis. Only applies when AllowDifferentSizedItems is enabled.
- **Type**: ItemAlignment
### CanHierarchicallyScrollAndVirtualizeCore
- **Description**: Indicates whether the panel can virtualize items that are grouped or organized in a hierarchy.
- **Type**: bool
### HasLogicalOrientation
- **Description**: Indicates whether this panel arranges its descendants in a single dimension.
- **Type**: bool
```
--------------------------------
### VirtualizingPanel Methods
Source: https://github.com/sbaeumlisberger/virtualizingwrappanel/blob/master/docs/api/WpfToolkit.Controls.VirtualizingWrapPanelWithItemExpansion.html
Provides methods for interacting with and managing items within the VirtualizingPanel.
```APIDOC
## VirtualizingPanel Methods
### Description
Provides methods for interacting with and managing items within the VirtualizingPanel.
### Methods
- **GetItemOffset(UIElement)** (double) - Gets the offset of the specified UI element.
- **GetItemOffsetCore(UIElement)** (double) - Gets the offset of the specified UI element.
- **GetIsVirtualizing(DependencyObject)** (bool) - Gets a value that indicates whether virtualization is enabled for the specified dependency object.
- **SetIsVirtualizing(DependencyObject, bool)** - Sets a value that indicates whether virtualization is enabled for the specified dependency object.
- **GetVirtualizationMode(DependencyObject)** (VirtualizationMode) - Gets the virtualization mode for the specified dependency object.
- **SetVirtualizationMode(DependencyObject, VirtualizationMode)** - Sets the virtualization mode for the specified dependency object.
- **GetIsVirtualizingWhenGrouping(DependencyObject)** (bool) - Gets a value that indicates whether virtualization is enabled when grouping is used.
- **SetIsVirtualizingWhenGrouping(DependencyObject, bool)** - Sets a value that indicates whether virtualization is enabled when grouping is used.
- **GetScrollUnit(DependencyObject)** (ScrollUnit) - Gets the scroll unit for the specified dependency object.
- **SetScrollUnit(DependencyObject, ScrollUnit)** - Sets the scroll unit for the specified dependency object.
- **GetCacheLength(DependencyObject)** (VirtualizationCacheLength) - Gets the cache length for the specified dependency object.
- **SetCacheLength(DependencyObject, VirtualizationCacheLength)** - Sets the cache length for the specified dependency object.
- **GetCacheLengthUnit(DependencyObject)** (VirtualizationCacheLengthUnit) - Gets the cache length unit for the specified dependency object.
- **SetCacheLengthUnit(DependencyObject, VirtualizationCacheLengthUnit)** - Sets the cache length unit for the specified dependency object.
- **GetIsContainerVirtualizable(DependencyObject)** (bool) - Gets a value that indicates whether the container is virtualizable.
- **SetIsContainerVirtualizable(DependencyObject, bool)** - Sets a value that indicates whether the container is virtualizable.
- **AddInternalChild(UIElement)** - Adds the specified UI element to the collection of internal children.
- **InsertInternalChild(int, UIElement)** - Inserts the specified UI element at the specified index in the collection of internal children.
- **RemoveInternalChildRange(int, int)** - Removes a range of internal children starting from the specified index.
- **ShouldItemsChangeAffectLayout(bool, ItemsChangedEventArgs)** (bool) - Determines whether items change affects the layout.
- **ShouldItemsChangeAffectLayoutCore(bool, ItemsChangedEventArgs)** (bool) - Determines whether items change affects the layout.
- **BringIndexIntoViewPublic(int)** - Scrolls the content of the panel so that the item at the specified index is visible.
- **CanHierarchicallyScrollAndVirtualizeCore** (bool) - Gets a value that indicates whether the panel can hierarchically scroll and virtualize.
```
--------------------------------
### UIElement Event Handlers
Source: https://github.com/sbaeumlisberger/virtualizingwrappanel/blob/master/docs/api/WpfToolkit.Controls.GridDetailsView.html
Documentation for UIElement event handling methods.
```APIDOC
## UIElement Event Handlers
### Description
Methods for handling various UI events.
### Methods
#### OnAccessKey
- **Description**: Handles the AccessKey event.
- **Parameters**: AccessKeyEventArgs
#### OnLostFocus
- **Description**: Handles the LostFocus event.
- **Parameters**: RoutedEventArgs
#### OnManipulationStarting
- **Description**: Handles the ManipulationStarting event.
- **Parameters**: ManipulationStartingEventArgs
#### OnManipulationStarted
- **Description**: Handles the ManipulationStarted event.
- **Parameters**: ManipulationStartedEventArgs
#### OnManipulationDelta
- **Description**: Handles the ManipulationDelta event.
- **Parameters**: ManipulationDeltaEventArgs
#### OnManipulationInertiaStarting
- **Description**: Handles the ManipulationInertiaStarting event.
- **Parameters**: ManipulationInertiaStartingEventArgs
#### OnManipulationBoundaryFeedback
- **Description**: Handles the ManipulationBoundaryFeedback event.
- **Parameters**: ManipulationBoundaryFeedbackEventArgs
#### OnManipulationCompleted
- **Description**: Handles the ManipulationCompleted event.
- **Parameters**: ManipulationCompletedEventArgs
```