# DXApp.TemplateKitProject

@* Custom theme with a color swatch *@ @* Docs: https://js.devexpress.com/DevExtreme/Guide/Themes_and_Styles/Predefined_Themes/#Color_Swatches *@
@using(Html.DevExtreme().NamedTemplate("navigation-menu")) {
@functions{ string GetUrl(string pageName) => Url.Page(pageName); string GetCurrentUrl() => Url.Page(ViewContext.RouteData.Values["page"].ToString()); bool IsCurrentUrl(string pageName) => GetUrl(pageName) == GetCurrentUrl(); } @(Html.DevExtreme().TreeView() .Items(items => { items.Add() .Text("Home") .Icon("home") .Option("path", GetUrl("/Index")) .Selected(IsCurrentUrl("/Index")); items.Add() .Text("About") .Icon("info") .Option("path", GetUrl("/About")) .Selected(IsCurrentUrl("/About")); items.Add() .Text("Rechnungen") .Icon("doc") .Option("path", GetUrl("/Invoices/Index")) .Selected(IsCurrentUrl("/Invoices/Index")); items.Add() .Text("PDF hochladen") .Icon("upload") .Option("path", GetUrl("/Invoices/Upload")) .Selected(IsCurrentUrl("/Invoices/Upload")); }) .ExpandEvent(TreeViewExpandEvent.Click) .SelectionMode(NavSelectionMode.Single) .SelectedExpr("selected") .FocusStateEnabled(false) .Width(250) .OnItemClick("DevExtremeAspNetCoreAppMatRazorPages.onTreeViewItemClick") )
}