From 5bf0b891e9406390b28d8488a6cc559f06735fa0 Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Tue, 20 Mar 2018 12:55:33 +0000 Subject: [PATCH] In NavLink, support matching either complete URLs or just URL prefixes (both are necessary for typical nav menus) --- samples/StandaloneApp/Shared/NavMenu.cshtml | 2 +- .../Services/BrowserUriHelper.cs | 14 ++--- .../Routing/NavLink.cs | 55 ++++++++++++++++++- .../Routing/NavLinkMatch.cs | 23 ++++++++ .../Tests/RoutingTest.cs | 24 +++++++- .../BasicTestApp/RouterTest/Links.cshtml | 18 +++--- .../RouterTest/WithParameters.cshtml | 1 + 7 files changed, 116 insertions(+), 21 deletions(-) create mode 100644 src/Microsoft.AspNetCore.Blazor/Routing/NavLinkMatch.cs diff --git a/samples/StandaloneApp/Shared/NavMenu.cshtml b/samples/StandaloneApp/Shared/NavMenu.cshtml index bea04d0ce5..cfd37a55a2 100644 --- a/samples/StandaloneApp/Shared/NavMenu.cshtml +++ b/samples/StandaloneApp/Shared/NavMenu.cshtml @@ -13,7 +13,7 @@