-
Notifications
You must be signed in to change notification settings - Fork 101
Expand file tree
/
Copy pathComponentCard.razor.cs
More file actions
41 lines (32 loc) · 1.12 KB
/
ComponentCard.razor.cs
File metadata and controls
41 lines (32 loc) · 1.12 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
using Microsoft.AspNetCore.Components;
using MudExtensions.Docs.Services;
namespace MudExtensions.Docs.Components
{
public partial class ComponentCard
{
[Inject] NavigationManager? NavigationManager { get; set; }
[Parameter]
public string? Title { get; set; }
[Parameter]
public string? ComponentName { get; set; }
[Parameter]
public string? Description { get; set; }
[Parameter]
public RenderFragment? ChildContent { get; set; }
[Parameter]
public EventCallback OnClick { get; set; }
[Parameter]
public MudExtensionComponentInfo? Component { get; set; }
[Parameter]
public bool NavigateToComponentPage { get; set; } = true;
private void NavigateComponentPage()
{
if (!NavigateToComponentPage)
{
return;
}
string? properName = ComponentName?.Replace(" ", null);
NavigationManager?.NavigateTo($"/{(string.IsNullOrEmpty(properName) ? Title?.ToLowerInvariant() : properName.ToLowerInvariant())}");
}
}
}