-
Notifications
You must be signed in to change notification settings - Fork 101
Expand file tree
/
Copy pathComboBoxExample3.razor
More file actions
44 lines (39 loc) · 1.95 KB
/
ComboBoxExample3.razor
File metadata and controls
44 lines (39 loc) · 1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
@namespace MudExtensions.Docs.Examples
<MudGrid>
<MudItem xs="12" sm="8" Class="d-flex gap-4 justify-center">
<MudComboBox @bind-Value="@_value" @bind-SelectedValues="@_selectedValues" Variant="Variant.Filled" Label="Gryffindor" MultiSelection="true" Editable="_editable"
SelectAll="_selectAll" ShowCheckbox="_showCheckbox" Bordered="_bordered" Dense="_dense"
autocomplete="new-password" Color="_color" Clearable="_clearable">
@foreach (var item in characters)
{
<MudComboBoxItem Value="@item" Text="@item"></MudComboBoxItem>
}
</MudComboBox>
</MudItem>
<MudItem xs="12" sm="4">
<MudStack Spacing="4">
<MudSwitchM3 @bind-Value="@_editable" Label="Editable" Color="Color.Secondary" />
<MudSwitchM3 @bind-Value="@_selectAll" Label="Select All" Color="Color.Secondary" />
<MudSwitchM3 @bind-Value="@_showCheckbox" Label="Show Checkbox" Color="Color.Secondary" />
<MudSwitchM3 @bind-Value="@_bordered" Label="Bordered" Color="Color.Secondary" />
<MudSwitchM3 @bind-Value="@_clearable" Label="Clearable" Color="Color.Secondary" />
<MudSelectExtended @bind-Value="_dense" ItemCollection="@(Enum.GetValues<Dense>())" Label="Dense" Variant="Variant.Outlined" />
<MudSelectExtended @bind-Value="_color" ItemCollection="@(Enum.GetValues<Color>())" Label="Color" Variant="Variant.Outlined" />
</MudStack>
</MudItem>
</MudGrid>
@code {
string? _value;
IEnumerable<string> _selectedValues = new HashSet<string>() { "Harry Potter", "Ron Weasley" };
Dense _dense = Dense.Standard;
Color _color = Color.Primary;
bool _selectAll;
bool _bordered;
bool _showCheckbox = true;
bool _editable;
bool _clearable;
private string[] characters =
{
"Harry Potter", "Ron Weasley", "Hermione Granger", "Seamus Finnigan", "Oliver Wood"
};
}