|
4 | 4 | <MudItem xs="12" sm="8" Class="d-flex gap-8 align-top justify-center" Style="height: 500px"> |
5 | 5 | <MudPaper Width="300px" Elevation="0"> |
6 | 6 | <MudText Class="ma-4">Array List</MudText> |
7 | | - <MudListExtended ItemCollection="_states" Clickable="true" MaxItems="_maxItems" SearchBox="_searchBox" SearchFunc="@(new Func<string, string, bool>(SearchItems))" @bind-SelectedValue="_selectedState" /> |
| 7 | + <MudListExtended ItemCollection="_states" Clickable="true" MaxItems="_maxItems" SearchBox="_searchBox" @bind-SearchString="@_searchString" SearchFunc="@(new Func<string, string, bool>(SearchItems))" @bind-SelectedValue="_selectedState" /> |
8 | 8 | </MudPaper> |
9 | 9 |
|
10 | 10 | <MudPaper Width="300px" Elevation="0"> |
11 | 11 | <MudText Class="ma-4">Enum List</MudText> |
12 | | - <MudListExtended T="Continent" ItemCollection="(ICollection<Continent>)Enum.GetValues<Continent>()" Clickable="true" MaxItems="_maxItems" SearchBox="_searchBox" /> |
| 12 | + <MudListExtended T="Continent" ItemCollection="(ICollection<Continent>)Enum.GetValues<Continent>()" Clickable="true" MaxItems="_maxItems" SearchBox="_searchBox" @bind-SearchString="@_searchString" /> |
13 | 13 | </MudPaper> |
14 | 14 |
|
15 | 15 | <MudPaper Width="300px" Elevation="0"> |
16 | 16 | <MudText Class="ma-4">Complex Type List</MudText> |
17 | | - <MudListExtended T="ComplexTypes" ItemCollection="_complexTypeCollection" Clickable="true" MaxItems="_maxItems" SearchBox="_searchBox" |
| 17 | + <MudListExtended T="ComplexTypes" ItemCollection="_complexTypeCollection" Clickable="true" MaxItems="_maxItems" SearchBox="_searchBox" @bind-SearchString="@_searchString" |
18 | 18 | ToStringFunc="@(e => e?.Name + " " + e?.SurName)" /> |
19 | 19 | </MudPaper> |
20 | 20 | </MudItem> |
|
24 | 24 | <MudText>Selected State: @_selectedState</MudText> |
25 | 25 | <MudNumericField @bind-Value="_maxItems" Label="Max Items" Min="0" Max="16" HelperText="Between 0 - 16" HelperTextOnFocus="true" /> |
26 | 26 | <MudSwitchM3 @bind-Value="_searchBox" Color="Color.Primary" Label="SearchBox" /> |
| 27 | + <MudTextField Disabled="@(!_searchBox)" Immediate @bind-Value="_searchString" Label="Search String" HelperText="The string used for searching items"/> |
27 | 28 | </MudStack> |
28 | 29 | </MudItem> |
29 | 30 | </MudGrid> |
|
33 | 34 | int _maxItems = 8; |
34 | 35 | bool _searchBox = false; |
35 | 36 | string? _selectedState; |
| 37 | + string? _searchString; |
36 | 38 | ICollection<ComplexTypes> _complexTypeCollection = new List<ComplexTypes>() |
37 | 39 | { |
38 | 40 | new ComplexTypes() { Name = "John", SurName = "Star" }, |
|
0 commit comments