Skip to content

Commit c833865

Browse files
authored
docs(.NET10): Shell SearchHandler trimming guidance — prefer ItemTemplate; feature switch note; update ms.date (#2996)
1 parent a57f2d4 commit c833865

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

docs/fundamentals/shell/search.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: ".NET MAUI Shell search"
33
description: "Learn how .NET MAUI Shell apps can use integrated search functionality that's provided by a search box that can be added to the top of each page."
4-
ms.date: 10/30/2024
4+
ms.date: 08/19/2025
55
---
66

77
# .NET MAUI Shell search
@@ -122,6 +122,13 @@ The `AnimalSearchHandler.OnQueryChanged` method returns a `List` of `Animal` obj
122122
123123
::: moniker-end
124124

125+
::: moniker range=">=net-maui-10.0"
126+
127+
> [!TIP]
128+
> In .NET 10, trimming defaults and feature switches mean `SearchHandler.DisplayMemberName` is ignored when full trimming or Native AOT is enabled. Prefer using `ItemTemplate` for results, which is trim-safe and supported across platforms. If you must use `DisplayMemberName` in partially trimmed scenarios, you can opt back in by setting the `MauiShellSearchResultsRendererDisplayMemberNameSupported` feature switch to `true` in your project file. For details and tradeoffs, see [Trimming feature switches](~/deployment/trimming.md#trimming-feature-switches).
129+
130+
::: moniker-end
131+
125132
The `ShowsResults` property is set to `true`, so that search suggestions are displayed as the user enters a search query:
126133

127134
:::image type="content" source="media/search/search-results.png" alt-text="Screenshot of search results in a Shell SearchHandler, with results for the partial string M.":::

0 commit comments

Comments
 (0)