Skip to content

Commit 9984368

Browse files
[NET10] CollectionView/CarouselView handers (#2995)
* docs(.NET10): Note that optimized handlers are default for CollectionView/CarouselView on iOS/Mac Catalyst in .NET 10; update ms.date * Document reverting to .NET 9 behavior for CarouselView Added instructions to revert to .NET 9 behavior for CarouselView. * Document reverting to .NET 9 handler for CarouselView Added instructions to revert to .NET 9 behavior for CarouselView in MauiProgram.cs. * Clarify handler recommendation for CollectionView Updated the recommendation to use the new handler for CollectionView instead of CarouselView. --------- Co-authored-by: Gerald Versluis <[email protected]>
1 parent 7faa3ac commit 9984368

File tree

2 files changed

+42
-2
lines changed

2 files changed

+42
-2
lines changed

docs/user-interface/controls/carouselview/index.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "CarouselView"
33
description: "The .NET MAUI CarouselView is a view for presenting data in a scrollable layout, where users can swipe to move through a collection of items."
4-
ms.date: 09/30/2024
4+
ms.date: 08/19/2025
55
---
66

77
# CarouselView
@@ -17,3 +17,23 @@ By default, <xref:Microsoft.Maui.Controls.CarouselView> will display its items i
1717
By default, <xref:Microsoft.Maui.Controls.CarouselView> provides looped access to its collection of items. Therefore, swiping backwards from the first item in the collection will display the last item in the collection. Similarly, swiping forwards from the last item in the collection will return to the first item in the collection.
1818

1919
<xref:Microsoft.Maui.Controls.CarouselView> shares much of its implementation with <xref:Microsoft.Maui.Controls.CollectionView>. However, the two controls have different use cases. <xref:Microsoft.Maui.Controls.CollectionView> is typically used to present lists of data of any length, whereas <xref:Microsoft.Maui.Controls.CarouselView> is typically used to highlight information in a list of limited length. For more information about <xref:Microsoft.Maui.Controls.CollectionView>, see [CollectionView](~/user-interface/controls/collectionview/index.md).
20+
21+
::: moniker range=">=net-maui-10.0"
22+
23+
> [!NOTE]
24+
> On iOS and Mac Catalyst, the optimized handlers that were optional in .NET 9 are the default handlers for <xref:Microsoft.Maui.Controls.CarouselView> in .NET 10, providing improved performance and stability.
25+
26+
## Revert to .NET 9 behavior
27+
28+
We recommend using the new handler for <xref:Microsoft.Maui.Controls.CarouselView>, but if you would like to opt-out of this behavior and revert back to the .NET 9 handler, you can use the code below in your `MauiProgram.cs`.
29+
30+
```csharp
31+
#if IOS || MACCATALYST
32+
builder.ConfigureMauiHandlers(handlers =>
33+
{
34+
handlers.AddHandler<Microsoft.Maui.Controls.CarouselView, Microsoft.Maui.Controls.Handlers.Items.CarouselViewHandler>();
35+
});
36+
#endif
37+
```
38+
39+
::: moniker-end

docs/user-interface/controls/collectionview/index.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "CollectionView"
33
description: "The .NET MAUI CollectionView displays a scrollable list of selectable data items, using different layout specifications."
4-
ms.date: 08/30/2024
4+
ms.date: 08/19/2025
55
---
66

77
# CollectionView
@@ -16,6 +16,26 @@ The following screenshot shows a <xref:Microsoft.Maui.Controls.CollectionView> t
1616

1717
<xref:Microsoft.Maui.Controls.CollectionView> should be used for presenting lists of data that require scrolling or selection. A bindable layout can be used when the data to be displayed doesn't require scrolling or selection. For more information, see [BindableLayout](~/user-interface/layouts/bindablelayout.md).
1818

19+
::: moniker range=">=net-maui-10.0"
20+
21+
> [!NOTE]
22+
> On iOS and Mac Catalyst, the optimized handlers that were optional in .NET 9 are the default handlers for <xref:Microsoft.Maui.Controls.CollectionView> in .NET 10, providing improved performance and stability.
23+
24+
## Revert to .NET 9 behavior
25+
26+
We recommend using the new handler for <xref:Microsoft.Maui.Controls.CollectionView>, but if you want to opt-out of this behavior and revert back to the .NET 9 handler, you can use the code below in your `MauiProgram.cs`.
27+
28+
```csharp
29+
#if IOS || MACCATALYST
30+
builder.ConfigureMauiHandlers(handlers =>
31+
{
32+
handlers.AddHandler<Microsoft.Maui.Controls.CollectionView, Microsoft.Maui.Controls.Handlers.Items.CollectionViewHandler>();
33+
});
34+
#endif
35+
```
36+
37+
::: moniker-end
38+
1939
## CollectionView and ListView differences
2040

2141
While the <xref:Microsoft.Maui.Controls.CollectionView> and <xref:Microsoft.Maui.Controls.ListView> APIs are similar, there are some notable differences:

0 commit comments

Comments
 (0)