CompositionCollectionView 0.1.0
See the version list below for details.
dotnet add package CompositionCollectionView --version 0.1.0
NuGet\Install-Package CompositionCollectionView -Version 0.1.0
<PackageReference Include="CompositionCollectionView" Version="0.1.0" />
<PackageVersion Include="CompositionCollectionView" Version="0.1.0" />
<PackageReference Include="CompositionCollectionView" />
paket add CompositionCollectionView --version 0.1.0
#r "nuget: CompositionCollectionView, 0.1.0"
#:package CompositionCollectionView@0.1.0
#addin nuget:?package=CompositionCollectionView&version=0.1.0
#tool nuget:?package=CompositionCollectionView&version=0.1.0
CompositionCollectionView
A composition-driven collection view control for UWP and WinUI 3 / Windows App SDK, with fully customizable layouts and behaviors powered by Windows.UI.Composition.
Features
- Composition-powered animations — all element positioning, scaling, rotation, and opacity are driven by composition expression animations for smooth 60fps performance
- Custom layouts — extend
CompositionCollectionLayout<TId, TItem>to define how elements are positioned, scaled, and rotated - Animated layout transitions — smoothly animate between different layouts with
TransitionTo() - Behaviors — attach reusable behaviors like
InteractionTrackerBehaviorfor gesture-driven interactions - Interaction tracker gestures — define composable touch/pointer gestures with visual previews
- Multi-platform — ships as a single NuGet package targeting both UWP (
uap10.0.19041) and WinUI 3 (net9.0-windows10.0.19041.0)
Quick Start
<labs:CompositionCollectionView x:Name="collectionView"
Width="600" Height="200" />
// Define a simple horizontal layout
public class HorizontalLayout : CompositionCollectionLayout<uint, MyItem>
{
public HorizontalLayout(Func<uint, FrameworkElement> factory) : base(factory) { }
public override Vector3Node GetElementPositionNode(ElementReference<uint, MyItem> element)
=> ExpressionFunctions.Vector3(element.Id * 120, 0, 0);
}
// Create and use the layout
var layout = new HorizontalLayout(id => new MyItemControl());
collectionView.SetLayout(layout);
await collectionView.UpdateSource(myItems);
Solution Structure
CompositionCollectionView/
├── src/CompositionCollectionView/ # Control library (UWP + WinUI 3)
├── samples/
│ ├── CompositionCollectionView.Sample.Uwp/ # UWP sample app
│ └── CompositionCollectionView.Sample.WinUI3/ # WinUI 3 sample app
Building
Build with Visual Studio 2022+ or MSBuild:
msbuild CompositionCollectionView.sln /p:Platform=x64
Architecture
CompositionCollectionLayout
The core abstract class you extend to define layouts. Override these methods:
| Method | Purpose |
|---|---|
GetElementPositionNode() |
Return an expression node for element position |
GetElementScaleNode() |
Return an expression node for element scale |
GetElementOpacityNode() |
Return an expression node for element opacity |
GetElementOrientationNode() |
Return an expression node for element orientation |
GetElementTransitionEasingFunction() |
Define transition animation easing |
Behaviors
Attach CompositionCollectionLayoutBehavior<TId, TItem> instances to layouts for reusable functionality:
InteractionTrackerBehavior— wrapsVisualInteractionSource+InteractionTrackerfor gesture handlingElementInteractionTrackerBehavior— per-element interaction trackersInteractionTrackerGesture— composable gesture definitions with visual previews
ExpressionsFork
An internal fork of the Windows Community Toolkit's expression animation helpers, with added Evaluate() method support.
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0-windows10.0.19041 is compatible. |
| Universal Windows Platform | uap10.0.19041 is compatible. |
-
net10.0-windows10.0.19041
- Microsoft.WindowsAppSDK (>= 1.7.250401001)
-
UAP 10.0.19041
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.