Skip to content
Draft
Changes from all 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
16 changes: 11 additions & 5 deletions docs/fundamentals/shell/search.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,13 @@ The subclassed <xref:Microsoft.Maui.Controls.SearchHandler> can be consumed by s

```xaml
<ContentPage ...
xmlns:controls="clr-namespace:Xaminals.Controls">
xmlns:controls="clr-namespace:Xaminals.Controls"
xmlns:data="clr-namespace:Xaminals.Data">
<Shell.SearchHandler>
<controls:AnimalSearchHandler Placeholder="Enter search term"
ShowsResults="true"
DisplayMemberName="Name" />
DisplayMemberName="Name"
Animals="{x:Static data:CatData.Cats}" />
</Shell.SearchHandler>
...
</ContentPage>
Expand All @@ -109,7 +111,8 @@ Shell.SetSearchHandler(this, new AnimalSearchHandler
{
Placeholder = "Enter search term",
ShowsResults = true,
DisplayMemberName = "Name"
DisplayMemberName = "Name",
Animals = CatData.Cats
});
```

Expand Down Expand Up @@ -147,10 +150,13 @@ In addition to displaying `string` data in the search results, the appearance of

```xaml
<ContentPage ...
xmlns:controls="clr-namespace:Xaminals.Controls">
xmlns:controls="clr-namespace:Xaminals.Controls"
xmlns:data="clr-namespace:Xaminals.Data"
xmlns:models="clr-namespace:Xaminals.Models">
<Shell.SearchHandler>
<controls:AnimalSearchHandler Placeholder="Enter search term"
ShowsResults="true">
ShowsResults="true"
Animals="{x:Static data:CatData.Cats}">
<controls:AnimalSearchHandler.ItemTemplate>
<DataTemplate x:DataType="models:Animal">
<Grid Padding="10"
Expand Down