Skip to content
Closed
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 22 additions & 5 deletions docs/user-interface/controls/collectionview/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,41 @@ The following screenshot shows a <xref:Microsoft.Maui.Controls.CollectionView> t

<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).

::: moniker range=">=net-maui-10.0"
::: moniker range="net-maui-10.0 net-maui-11.0"
Comment thread
SuthiYuvaraj marked this conversation as resolved.
Outdated

> [!NOTE]
> 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.
> `CollectionView` optimized handlers became default at different times per platform:
>
> | Platform | Availability before default | Default starting in |
> | --- | --- | --- |
> | iOS / Mac Catalyst | .NET 9 (optional) | .NET 10 |
> | Windows | Not available before .NET 11 | .NET 11 |
>
> These optimized handlers provide improved stability and performance.

## Revert to .NET 9 behavior
## Revert to previous behavior

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`.
We recommend using the new handler for <xref:Microsoft.Maui.Controls.CollectionView>, but if you want to opt out and revert to the previous handler behavior, you can use the code below in your `MauiProgram.cs`.

Configure handlers in `MauiProgram.cs`:

```csharp
#if IOS || MACCATALYST
#if IOS || MACCATALYST || WINDOWS
builder.ConfigureMauiHandlers(handlers =>
{
handlers.AddHandler<Microsoft.Maui.Controls.CollectionView, Microsoft.Maui.Controls.Handlers.Items.CollectionViewHandler>();
});
#endif
```

On Windows, you can also use the `UseWindowsCollectionView2Handler` build property in your project file.

```xml
<PropertyGroup>
<UseWindowsCollectionView2Handler>false</UseWindowsCollectionView2Handler>
</PropertyGroup>
```

::: moniker-end

## CollectionView and ListView differences
Expand Down
12 changes: 12 additions & 0 deletions docs/whats-new/dotnet-11.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,18 @@ In .NET 11 Preview 4, the Android handlers for several core controls use Materia

In .NET 11 Preview 5, the underlying Material 3 helper types (`MauiMaterialEditText`, `MauiMaterialDatePicker`, `MauiMaterialPicker`, `MauiMaterialTimePicker`, `MauiMaterialTextView`, `MauiMaterialSearchBarTextInputLayout`, `MaterialActivityIndicator`, and `MauiMaterialContextThemeWrapper`) are public so you can subclass them from your own handler customizations. For more information, see [GitHub PR #35323](https://github.com/dotnet/maui/pull/35323) and [Material 3](~/user-interface/material-design.md).

### CollectionView v2 on Windows

Starting in .NET 11 Preview 6, <xref:Microsoft.Maui.Controls.CollectionView> on Windows now uses optimized default handlers, providing improved performance and stability. For more information, see [GitHub PR #34600](https://github.com/dotnet/maui/pull/34600).

If you need to revert to the previous handler, you can disable the CollectionView v2 handler by setting the `UseWindowsCollectionView2Handler` build property to `false` in your project file:

```xml
<PropertyGroup>
<UseWindowsCollectionView2Handler>false</UseWindowsCollectionView2Handler>
</PropertyGroup>
```

### BoxView Fill property

:::moniker range=">=net-maui-11.0"
Expand Down
Loading