ant-design-blazor/components/breadcrumb/Breadcrumb.razor.cs

52 lines
1.2 KiB
C#
Raw Normal View History

2020-04-24 18:32:50 +08:00
using System;
using System.Collections.Generic;
2020-03-08 22:32:30 +08:00
using Microsoft.AspNetCore.Components;
namespace AntBlazor
{
public partial class Breadcrumb : AntDomComponentBase
2020-03-08 22:32:30 +08:00
{
[Parameter]
public RenderFragment ChildContent { get; set; }
[Parameter]
public bool AutoGenerate { get; set; } = false;
2020-03-08 22:32:30 +08:00
[Parameter]
public string Separator { get; set; } = "/";
2020-03-08 22:32:30 +08:00
[Parameter]
public string RouteLabel { get; set; } = "breadcrumb";
2020-03-08 22:32:30 +08:00
[Inject]
public NavigationManager NavigationManager { get; set; }
2020-03-08 22:32:30 +08:00
2020-04-24 18:32:50 +08:00
private readonly BreadcrumbOption[] _breadcrumbs = Array.Empty<BreadcrumbOption>();
2020-03-08 22:32:30 +08:00
2020-04-24 18:32:50 +08:00
private void Navigate(string url)
2020-03-08 22:32:30 +08:00
{
NavigationManager.NavigateTo(url);
2020-03-08 22:32:30 +08:00
}
protected override void OnInitialized()
{
this.ClassMapper.Add("ant-breadcrumb");
base.OnInitialized();
}
private void RegisterRouterChange()
2020-03-08 22:32:30 +08:00
{
}
}
2020-04-24 18:32:50 +08:00
public class BreadcrumbOption
2020-03-08 22:32:30 +08:00
{
public string Label { get; set; }
public Dictionary<string, object> Params { get; set; }
2020-04-24 18:32:50 +08:00
public Uri Url { get; set; }
2020-03-08 22:32:30 +08:00
}
}