Extracted some pages to their own assembly and finished the artifact display page code
This commit is contained in:
@@ -5,9 +5,17 @@
|
||||
@* Loop through and display each item as a chip *@
|
||||
@foreach (var item in Items)
|
||||
{
|
||||
<MudChip Color="Color.Primary" OnClose="() => RemoveItem(item)" T="T">
|
||||
@DisplayFunc(item)
|
||||
</MudChip>
|
||||
@if (DeleteEnabled)
|
||||
{
|
||||
<MudChip Color="Color.Primary" OnClose="() => RemoveItem(item)" T="T">
|
||||
@DisplayFunc(item)
|
||||
</MudChip>
|
||||
} else
|
||||
{
|
||||
<MudChip Color="Color.Primary" T="T">
|
||||
@DisplayFunc(item)
|
||||
</MudChip>
|
||||
}
|
||||
}
|
||||
|
||||
@* Render the input control provided by the consumer *@
|
||||
@@ -22,6 +30,9 @@
|
||||
</div>
|
||||
|
||||
@code {
|
||||
[Parameter]
|
||||
public bool DeleteEnabled { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// The list of items to display and manage.
|
||||
/// </summary>
|
||||
@@ -51,8 +62,6 @@
|
||||
[Parameter]
|
||||
public Func<T, string> DisplayFunc { get; set; } = item => item?.ToString() ?? string.Empty;
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A public method that the consumer's input control can call to add a new item.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user