I18NCommander/I18N Commander/UI MAUI/Components/NavItem.razor.cs

25 lines
610 B
C#
Raw Normal View History

using Microsoft.AspNetCore.Components;
namespace UI_MAUI.Components;
public partial class NavItem : ComponentBase
{
[Parameter]
public string Route { get; set; }
[Parameter]
public string Text { get; set; }
[Parameter]
public bool ShowIcon { get; set; } = false;
[Parameter]
public string IconFilename { get; set; } = string.Empty;
2022-08-12 21:57:39 +00:00
[Inject]
public NavigationManager NavigationManager { get; set; }
private string AltText => $"Navigation: {this.Text}";
2022-08-12 21:57:39 +00:00
private void Navigate() => this.NavigationManager.NavigateTo(this.Route);
}